﻿using System;
using System.Collections.Generic;
using System.Linq;
using Irony.Parsing;
using Roslyn.Compilers.CSharp;

//"ProjectStruct" extension method is used for ast node constructions
public /*abstract*/ class CSGrammar : Grammar
{
    internal readonly CommentTerminal SingleLineComment = new CommentTerminal("SingleLineComment", "//", NewLineStrings);
    internal readonly CommentTerminal DelimitedComment = new CommentTerminal("DelimitedComment", "/*", "*/");
    #region tokens
    internal readonly Terminal TildeToken;// ~
    internal readonly Terminal ExclamationToken;// !
    internal readonly Terminal DollarToken;// $
    internal readonly Terminal PercentToken;// %
    internal readonly Terminal CaretToken;// ^
    internal readonly Terminal AmpersandToken;// &
    internal readonly Terminal AsteriskToken;// *
    internal readonly Terminal OpenParenToken;// (
    internal readonly Terminal CloseParenToken;// )
    internal readonly Terminal MinusToken;// -
    internal readonly Terminal PlusToken;// +
    internal readonly Terminal EqualsToken;// =
    internal readonly Terminal OpenBraceToken;// {
    internal readonly Terminal CloseBraceToken;// }
    internal readonly Terminal OpenBracketToken;// [
    internal readonly Terminal CloseBracketToken;// ]
    internal readonly Terminal BarToken;// |
    internal readonly Terminal BackslashToken;// \
    internal readonly Terminal ColonToken;// :
    internal readonly Terminal SemicolonToken;// ;
    internal readonly Terminal DoubleQuoteToken;// "
    internal readonly Terminal SingleQuoteToken;// '
    internal readonly Terminal LessThanToken;// <
    internal readonly Terminal CommaToken;// ,
    internal readonly Terminal GreaterThanToken;// >
    internal readonly Terminal DotToken;// .
    internal readonly Terminal QuestionToken;// ?
    internal readonly Terminal HashToken;// #
    internal readonly Terminal SlashToken;// /
    internal readonly Terminal SlashGreaterThanToken;// />
    internal readonly Terminal LessThanSlashToken;// </
    internal readonly Terminal XmlCommentStartToken;// <!--
    internal readonly Terminal XmlCommentEndToken;// -->
    internal readonly Terminal XmlCDataStartToken;// <![CDATA[
    internal readonly Terminal XmlCDataEndToken;// ]]>
    internal readonly Terminal XmlProcessingInstructionStartToken;// <?
    internal readonly Terminal XmlProcessingInstructionEndToken;// ?>
    internal readonly Terminal BarBarToken;// ||
    internal readonly Terminal AmpersandAmpersandToken;// &&
    internal readonly Terminal MinusMinusToken;// --
    internal readonly Terminal PlusPlusToken;// ++
    internal readonly Terminal ColonColonToken;// ::
    internal readonly Terminal QuestionQuestionToken;// ??
    internal readonly Terminal MinusGreaterThanToken;// ->
    internal readonly Terminal ExclamationEqualsToken;// !=
    internal readonly Terminal EqualsEqualsToken;// ==
    internal readonly Terminal EqualsGreaterThanToken;// =>
    internal readonly Terminal LessThanEqualsToken;// <=
    internal readonly Terminal LessThanLessThanToken;// <<
    internal readonly Terminal LessThanLessThanEqualsToken;// <<=
    internal readonly Terminal GreaterThanEqualsToken;// >=
    internal readonly Terminal GreaterThanGreaterThanToken;// >>
    internal readonly Terminal GreaterThanGreaterThanEqualsToken;// >>=
    internal readonly Terminal SlashEqualsToken;// /=
    internal readonly Terminal AsteriskEqualsToken;// *=
    internal readonly Terminal BarEqualsToken;// |=
    internal readonly Terminal AmpersandEqualsToken;// &=
    internal readonly Terminal PlusEqualsToken;// +=
    internal readonly Terminal MinusEqualsToken;// -=
    internal readonly Terminal CaretEqualsToken;// ^=
    internal readonly Terminal PercentEqualsToken;// %=
    internal readonly Terminal BoolKeyword;// bool
    internal readonly Terminal ByteKeyword;// byte
    internal readonly Terminal SByteKeyword;// sbyte
    internal readonly Terminal ShortKeyword;// short
    internal readonly Terminal UShortKeyword;// ushort
    internal readonly Terminal IntKeyword;// int
    internal readonly Terminal UIntKeyword;// uint
    internal readonly Terminal LongKeyword;// long
    internal readonly Terminal ULongKeyword;// ulong
    internal readonly Terminal DoubleKeyword;// double
    internal readonly Terminal FloatKeyword;// float
    internal readonly Terminal DecimalKeyword;// decimal
    internal readonly Terminal StringKeyword;// string
    internal readonly Terminal CharKeyword;// char
    internal readonly Terminal VoidKeyword;// void
    internal readonly Terminal ObjectKeyword;// object
    internal readonly Terminal TypeOfKeyword;// typeof
    internal readonly Terminal SizeOfKeyword;// sizeof
    internal readonly Terminal NullKeyword;// null
    internal readonly Terminal TrueKeyword;// true
    internal readonly Terminal FalseKeyword;// false
    internal readonly Terminal IfKeyword;// if
    internal readonly Terminal ElseKeyword;// else
    internal readonly Terminal WhileKeyword;// while
    internal readonly Terminal ForKeyword;// for
    internal readonly Terminal ForEachKeyword;// foreach
    internal readonly Terminal DoKeyword;// do
    internal readonly Terminal SwitchKeyword;// switch
    internal readonly Terminal CaseKeyword;// case
    internal readonly Terminal DefaultKeyword;// default
    internal readonly Terminal TryKeyword;// try
    internal readonly Terminal CatchKeyword;// catch
    internal readonly Terminal FinallyKeyword;// finally
    internal readonly Terminal LockKeyword;// lock
    internal readonly Terminal GotoKeyword;// goto
    internal readonly Terminal BreakKeyword;// break
    internal readonly Terminal ContinueKeyword;// continue
    internal readonly Terminal ReturnKeyword;// return
    internal readonly Terminal ThrowKeyword;// throw
    internal readonly Terminal PublicKeyword;// public
    internal readonly Terminal PrivateKeyword;// private
    internal readonly Terminal InternalKeyword;// internal
    internal readonly Terminal ProtectedKeyword;// protected
    internal readonly Terminal StaticKeyword;// static
    internal readonly Terminal ReadOnlyKeyword;// readonly
    internal readonly Terminal SealedKeyword;// sealed
    internal readonly Terminal ConstKeyword;// const
    internal readonly Terminal FixedKeyword;// fixed
    internal readonly Terminal StackAllocKeyword;// stackalloc
    internal readonly Terminal VolatileKeyword;// volatile
    internal readonly Terminal NewKeyword;// new
    internal readonly Terminal OverrideKeyword;// override
    internal readonly Terminal AbstractKeyword;// abstract
    internal readonly Terminal VirtualKeyword;// virtual
    internal readonly Terminal EventKeyword;// event
    internal readonly Terminal ExternKeyword;// extern
    internal readonly Terminal RefKeyword;// ref
    internal readonly Terminal OutKeyword;// out
    internal readonly Terminal InKeyword;// in
    internal readonly Terminal IsKeyword;// is
    internal readonly Terminal AsKeyword;// as
    internal readonly Terminal ParamsKeyword;// params
    internal readonly Terminal ArgListKeyword;// __arglist
    internal readonly Terminal MakeRefKeyword;// __makeref
    internal readonly Terminal RefTypeKeyword;// __reftype
    internal readonly Terminal RefValueKeyword;// __refvalue
    internal readonly Terminal ThisKeyword;// this
    internal readonly Terminal BaseKeyword;// base
    internal readonly Terminal NamespaceKeyword;// namespace
    internal readonly Terminal UsingKeyword;// using
    internal readonly Terminal ClassKeyword;// class
    internal readonly Terminal StructKeyword;// struct
    internal readonly Terminal InterfaceKeyword;// interface
    internal readonly Terminal EnumKeyword;// enum
    internal readonly Terminal DelegateKeyword;// delegate
    internal readonly Terminal CheckedKeyword;// checked
    internal readonly Terminal UncheckedKeyword;// unchecked
    internal readonly Terminal UnsafeKeyword;// unsafe
    internal readonly Terminal OperatorKeyword;// operator
    internal readonly Terminal ExplicitKeyword;// explicit
    internal readonly Terminal ImplicitKeyword;// implicit
    internal readonly Terminal YieldKeyword;// yield
    internal readonly Terminal PartialKeyword;// partial
    internal readonly Terminal AliasKeyword;// alias
    internal readonly Terminal GlobalKeyword;// global
    internal readonly Terminal AssemblyKeyword;// assembly
    internal readonly Terminal ModuleKeyword;// module
    internal readonly Terminal TypeKeyword;// type
    internal readonly Terminal FieldKeyword;// field
    internal readonly Terminal MethodKeyword;// method
    internal readonly Terminal ParamKeyword;// param
    internal readonly Terminal PropertyKeyword;// property
    internal readonly Terminal TypeVarKeyword;// typevar
    internal readonly Terminal GetKeyword;// get
    internal readonly Terminal SetKeyword;// set
    internal readonly Terminal AddKeyword;// add
    internal readonly Terminal RemoveKeyword;// remove
    internal readonly Terminal WhereKeyword;// where
    internal readonly Terminal FromKeyword;// from
    internal readonly Terminal GroupKeyword;// group
    internal readonly Terminal JoinKeyword;// join
    internal readonly Terminal IntoKeyword;// into
    internal readonly Terminal LetKeyword;// let
    internal readonly Terminal ByKeyword;// by
    internal readonly Terminal SelectKeyword;// select
    internal readonly Terminal OrderByKeyword;// orderby
    internal readonly Terminal OnKeyword;// on
    internal readonly Terminal EqualsKeyword;// equals
    internal readonly Terminal AscendingKeyword;// ascending
    internal readonly Terminal DescendingKeyword;// descending
    internal readonly Terminal AsyncKeyword;// async
    internal readonly Terminal AwaitKeyword;// await
    internal readonly Terminal ElifKeyword;// elif
    internal readonly Terminal EndIfKeyword;// endif
    internal readonly Terminal RegionKeyword;// region
    internal readonly Terminal EndRegionKeyword;// endregion
    internal readonly Terminal DefineKeyword;// define
    internal readonly Terminal UndefKeyword;// undef
    internal readonly Terminal WarningKeyword;// warning
    internal readonly Terminal ErrorKeyword;// error
    internal readonly Terminal LineKeyword;// line
    internal readonly Terminal PragmaKeyword;// pragma
    internal readonly Terminal HiddenKeyword;// hidden
    internal readonly Terminal ChecksumKeyword;// checksum
    internal readonly Terminal DisableKeyword;// disable
    internal readonly Terminal RestoreKeyword;// restore
    internal readonly Terminal ReferenceKeyword;// r
    #endregion tokens
    internal readonly Terminal IdentifierToken = TerminalFactory.CreateCSharpIdentifier("IdentifierToken").ProjectStruct("_SyntaxToken", Node.Int32("Kind", (int)SyntaxKind.IdentifierToken));//, new FlagProjectionArgument("Text", ProjectionFlags.AtomTokenText), new FlagProjectionArgument("Value", ProjectionFlags.AtomTokenValue));
    internal readonly Terminal StringLiteralToken = TerminalFactory.CreateCSharpString("StringLiteralToken").ProjectStruct("_SyntaxToken", Node.Int32("Kind", (int)SyntaxKind.StringLiteralToken));//, new FlagProjectionArgument("Text", ProjectionFlags.AtomTokenText), new FlagProjectionArgument("Value", ProjectionFlags.AtomTokenValue));
    internal readonly Terminal CharacterLiteralToken = TerminalFactory.CreateCSharpChar("CharacterLiteralToken").ProjectStruct("_SyntaxToken", Node.Int32("Kind", (int)SyntaxKind.CharacterLiteralToken));//, new FlagProjectionArgument("Text", ProjectionFlags.AtomTokenText), new FlagProjectionArgument("Value", ProjectionFlags.AtomTokenValue));
    internal readonly Terminal NumericLiteralToken = TerminalFactory.CreateCSharpNumber("NumericLiteralToken").ProjectStruct("_SyntaxToken", Node.Int32("Kind", (int)SyntaxKind.NumericLiteralToken));//, new FlagProjectionArgument("Text", ProjectionFlags.AtomTokenText), new FlagProjectionArgument("Value", ProjectionFlags.AtomTokenValue));
    //
    //conventions:
    //X_s: non-empty list
    //X_sc: non-empty separated list, CommaToken separator
    //X_scc: non-empty separated list, CommaToken separator, AllowTrailingDelimiter
    //X_opt: optional
    //
    internal readonly NonTerminal compilation_unit = new NonTerminal("compilation_unit");
    //
    internal readonly NonTerminal extern_alias_directive_s_opt = new NonTerminal("extern_alias_directive_s_opt");
    internal readonly NonTerminal extern_alias_directive_s = new NonTerminal("extern_alias_directive_s");
    internal readonly NonTerminal extern_alias_directive = new NonTerminal("extern_alias_directive");
    //
    internal readonly NonTerminal using_directive_s_opt = new NonTerminal("using_directive_s_opt");
    internal readonly NonTerminal using_directive_s = new NonTerminal("using_directive_s");
    internal readonly NonTerminal using_directive = new NonTerminal("using_directive");
    internal readonly NonTerminal using_directive_alias = new NonTerminal("using_directive_alias");
    internal readonly NonTerminal using_directive_namespace = new NonTerminal("using_directive_namespace");
    //
    internal readonly NonTerminal global_attribute_list_s_opt = new NonTerminal("global_attribute_list_s_opt");
    internal readonly NonTerminal global_attribute_list_s = new NonTerminal("global_attribute_list_s");
    internal readonly NonTerminal global_attribute_list = new NonTerminal("global_attribute_list");
    internal readonly NonTerminal global_attribute_target_specifier = new NonTerminal("global_attribute_target_specifier");
    internal readonly NonTerminal global_attribute_target_specifier_identifier = new NonTerminal("global_attribute_target_specifier_identifier");
    //
    internal readonly NonTerminal attribute_list_s_opt = new NonTerminal("attribute_list_s_opt");
    internal readonly NonTerminal attribute_list_s = new NonTerminal("attribute_list_s");
    internal readonly NonTerminal attribute_list = new NonTerminal("attribute_list");
    internal readonly NonTerminal attribute_target_specifier_opt = new NonTerminal("attribute_target_specifier_opt");
    internal readonly NonTerminal attribute_target_specifier = new NonTerminal("attribute_target_specifier");
    internal readonly NonTerminal attribute_target_specifier_identifier = new NonTerminal("attribute_target_specifier_identifier");
    //
    internal readonly NonTerminal attribute_scc = new NonTerminal("attribute_scc");
    internal readonly NonTerminal attribute = new NonTerminal("attribute");
    internal readonly NonTerminal attribute_argument_list_opt = new NonTerminal("attribute_argument_list_opt");
    internal readonly NonTerminal attribute_argument_list = new NonTerminal("attribute_argument_list");
    internal readonly NonTerminal attribute_argument_sc_opt = new NonTerminal("attribute_argument_sc_opt");
    internal readonly NonTerminal attribute_argument_sc = new NonTerminal("attribute_argument_sc");
    internal readonly NonTerminal attribute_argument = new NonTerminal("attribute_argument");
    internal readonly NonTerminal attribute_argument_name_equals = new NonTerminal("attribute_argument_name_equals");
    internal readonly NonTerminal attribute_argument_name_colon = new NonTerminal("attribute_argument_name_colon");
    internal readonly NonTerminal attribute_argument_expression = new NonTerminal("attribute_argument_expression");
    //
    internal readonly NonTerminal global_namespace_member_s_opt = new NonTerminal("global_namespace_member_s_opt");
    internal readonly NonTerminal global_namespace_member_s = new NonTerminal("global_namespace_member_s");
    internal readonly NonTerminal global_namespace_member = new NonTerminal("global_namespace_member");
    internal readonly NonTerminal namespace_declaration = new NonTerminal("namespace_declaration");
    internal readonly NonTerminal namespace_prolog_s_opt = new NonTerminal("namespace_prolog_s_opt");
    internal readonly NonTerminal namespace_prolog_s = new NonTerminal("namespace_prolog_s");
    internal readonly NonTerminal namespace_prolog = new NonTerminal("namespace_prolog");
    internal readonly NonTerminal namespace_member_s_opt = new NonTerminal("namespace_member_s_opt");
    internal readonly NonTerminal namespace_member_s = new NonTerminal("namespace_member_s");
    internal readonly NonTerminal namespace_member = new NonTerminal("namespace_member");
    //
    internal readonly NonTerminal accessibility_element = new NonTerminal("accessibility_element");
    internal readonly NonTerminal modifier_s_opt = new NonTerminal("modifier_s_opt");
    internal readonly NonTerminal modifier_s = new NonTerminal("modifier_s");
    internal readonly NonTerminal modifier = new NonTerminal("modifier");
    //
    internal readonly NonTerminal type_declaration = new NonTerminal("type_declaration");
    internal readonly NonTerminal delegate_declaration = new NonTerminal("delegate_declaration");
    internal readonly NonTerminal enum_declaration = new NonTerminal("enum_declaration");
    internal readonly NonTerminal enum_member_declaration_scc_opt = new NonTerminal("enum_member_declaration_scc_opt");
    internal readonly NonTerminal enum_member_declaration_scc = new NonTerminal("enum_member_declaration_scc");
    internal readonly NonTerminal enum_member_declaration = new NonTerminal("enum_member_declaration");
    internal readonly NonTerminal class_declaration = new NonTerminal("class_declaration");
    internal readonly NonTerminal struct_declaration = new NonTerminal("struct_declaration");
    internal readonly NonTerminal interface_declaration = new NonTerminal("interface_declaration");
    //
    internal readonly NonTerminal type_member_s_opt = new NonTerminal("type_member_s_opt");
    internal readonly NonTerminal type_member_s = new NonTerminal("type_member_s");
    internal readonly NonTerminal type_member = new NonTerminal("type_member");
    internal readonly NonTerminal field_declaration = new NonTerminal("field_declaration");
    internal readonly NonTerminal event_field_declaration = new NonTerminal("event_field_declaration");
    internal readonly NonTerminal method_declaration = new NonTerminal("method_declaration");
    internal readonly NonTerminal operator_declaration = new NonTerminal("operator_declaration");
    internal readonly NonTerminal overloadable_operator = new NonTerminal("overloadable_operator");
    internal readonly NonTerminal conversion_operator_declaration = new NonTerminal("conversion_operator_declaration");
    internal readonly NonTerminal implicit_or_explicit_keyword = new NonTerminal("implicit_or_explicit_keyword");
    internal readonly NonTerminal constructor_declaration = new NonTerminal("constructor_declaration");
    internal readonly NonTerminal constructor_initializer_opt = new NonTerminal("constructor_initializer_opt");
    internal readonly NonTerminal constructor_initializer = new NonTerminal("constructor_initializer");
    internal readonly NonTerminal constructor_initializer_this = new NonTerminal("constructor_initializer_this");
    internal readonly NonTerminal constructor_initializer_base = new NonTerminal("constructor_initializer_base");
    internal readonly NonTerminal destructor_declaration = new NonTerminal("destructor_declaration");
    internal readonly NonTerminal property_declaration = new NonTerminal("property_declaration");
    internal readonly NonTerminal indexer_declaration = new NonTerminal("indexer_declaration");
    internal readonly NonTerminal property_accessor_list = new NonTerminal("property_accessor_list");
    internal readonly NonTerminal property_accessor_declaration_s = new NonTerminal("property_accessor_declaration_s");
    internal readonly NonTerminal property_accessor_declaration = new NonTerminal("property_accessor_declaration");
    internal readonly NonTerminal property_accessor_declaration_get = new NonTerminal("property_accessor_declaration_get");
    internal readonly NonTerminal property_accessor_declaration_set = new NonTerminal("property_accessor_declaration_set");
    internal readonly NonTerminal event_declaration = new NonTerminal("event_declaration");
    internal readonly NonTerminal event_accessor_list = new NonTerminal("event_accessor_list");
    internal readonly NonTerminal event_accessor_declaration_s = new NonTerminal("event_accessor_declaration_s");
    internal readonly NonTerminal event_accessor_declaration = new NonTerminal("event_accessor_declaration");
    internal readonly NonTerminal event_accessor_declaration_add = new NonTerminal("event_accessor_declaration_add");
    internal readonly NonTerminal event_accessor_declaration_remove = new NonTerminal("event_accessor_declaration_remove");
    //
    internal readonly NonTerminal base_list_opt = new NonTerminal("base_list_opt");
    internal readonly NonTerminal base_list = new NonTerminal("base_list");
    internal readonly NonTerminal explicit_interface_specifier_opt = new NonTerminal("explicit_interface_specifier_opt");
    internal readonly NonTerminal explicit_interface_specifier = new NonTerminal("explicit_interface_specifier");
    internal readonly NonTerminal type_argument_list = new NonTerminal("type_argument_list");
    internal readonly NonTerminal type_argument_list_arguments = new NonTerminal("type_argument_list_arguments");
    internal readonly NonTerminal type_argument_list_arguments_omitted = new NonTerminal("type_argument_list_arguments_omitted");
    internal readonly NonTerminal type_argument_list_arguments_separated = new NonTerminal("type_argument_list_arguments_separated");
    internal readonly NonTerminal type_parameter_list_opt = new NonTerminal("type_parameter_list_opt");
    internal readonly NonTerminal type_parameter_list = new NonTerminal("type_parameter_list");
    internal readonly NonTerminal type_parameter_sc = new NonTerminal("type_parameter_sc");
    internal readonly NonTerminal type_parameter = new NonTerminal("type_parameter");
    internal readonly NonTerminal variance_keyword_opt = new NonTerminal("variance_keyword_opt");
    internal readonly NonTerminal variance_keyword = new NonTerminal("variance_keyword");
    internal readonly NonTerminal type_parameter_constraint_clause_s_opt = new NonTerminal("type_parameter_constraint_clause_s_opt");
    internal readonly NonTerminal type_parameter_constraint_clause_s = new NonTerminal("type_parameter_constraint_clause_s");
    internal readonly NonTerminal type_parameter_constraint_clause = new NonTerminal("type_parameter_constraint_clause");
    internal readonly NonTerminal type_parameter_constraint_sc = new NonTerminal("type_parameter_constraint_sc");
    internal readonly NonTerminal type_parameter_constraint = new NonTerminal("type_parameter_constraint");
    internal readonly NonTerminal constructor_constraint = new NonTerminal("constructor_constraint");
    internal readonly NonTerminal type_constraint = new NonTerminal("type_constraint");
    internal readonly NonTerminal class_or_struct_constraint = new NonTerminal("class_or_struct_constraint");
    internal readonly NonTerminal class_or_struct_constraint_class = new NonTerminal("class_or_struct_constraint_class");
    internal readonly NonTerminal class_or_struct_constraint_struct = new NonTerminal("class_or_struct_constraint_struct");
    //
    internal readonly NonTerminal argument_list_opt = new NonTerminal("argument_list_opt");
    internal readonly NonTerminal argument_list = new NonTerminal("argument_list");
    internal readonly NonTerminal bracketed_argument_list_opt = new NonTerminal("bracketed_argument_list_opt");
    internal readonly NonTerminal bracketed_argument_list = new NonTerminal("bracketed_argument_list");
    internal readonly NonTerminal argument_sc_opt = new NonTerminal("argument_sc_opt");
    internal readonly NonTerminal argument_sc = new NonTerminal("argument_sc");
    internal readonly NonTerminal argument = new NonTerminal("argument");
    internal readonly NonTerminal ref_or_out_keyword_opt = new NonTerminal("ref_or_out_keyword_opt");
    internal readonly NonTerminal ref_or_out_keyword = new NonTerminal("ref_or_out_keyword");
    //
    internal readonly NonTerminal parameter_list_opt = new NonTerminal("parameter_list_opt");
    internal readonly NonTerminal parameter_list = new NonTerminal("parameter_list");
    internal readonly NonTerminal bracketed_parameter_list = new NonTerminal("bracketed_parameter_list");
    internal readonly NonTerminal parameter_sc_opt = new NonTerminal("parameter_sc_opt");
    internal readonly NonTerminal parameter_sc = new NonTerminal("parameter_sc");
    internal readonly NonTerminal parameter = new NonTerminal("parameter");
    internal readonly NonTerminal parameter_modifier_s_opt = new NonTerminal("parameter_modifier_s_opt");
    internal readonly NonTerminal parameter_modifier_s = new NonTerminal("parameter_modifier_s");
    internal readonly NonTerminal parameter_modifier = new NonTerminal("parameter_modifier");
    //
    internal readonly NonTerminal name_equals_opt = new NonTerminal("name_equals_opt");
    internal readonly NonTerminal name_equals = new NonTerminal("name_equals");
    internal readonly NonTerminal name_colon_opt = new NonTerminal("name_colon_opt");
    internal readonly NonTerminal name_colon = new NonTerminal("name_colon");
    internal readonly NonTerminal equals_value_clause_opt = new NonTerminal("equals_value_clause_opt");
    internal readonly NonTerminal equals_value_clause = new NonTerminal("equals_value_clause");
    //internal readonly NonTerminal  = new NonTerminal("");
    internal readonly NonTerminal statement_s_opt = new NonTerminal("statement_s_opt");
    internal readonly NonTerminal statement_s = new NonTerminal("statement_s");
    internal readonly NonTerminal statement = new NonTerminal("statement");
    internal readonly NonTerminal labeled_statement = new NonTerminal("labeled_statement");
    //
    internal readonly NonTerminal local_declaration_statement = new NonTerminal("local_declaration_statement");
    internal readonly NonTerminal variable_declaration_opt = new NonTerminal("variable_declaration_opt");
    internal readonly NonTerminal variable_declaration = new NonTerminal("variable_declaration");
    internal readonly NonTerminal variable_declarator_sc = new NonTerminal("variable_declarator_sc");
    internal readonly NonTerminal variable_declarator = new NonTerminal("variable_declarator");
    internal readonly NonTerminal equals_value_clause_variable_declarator_opt = new NonTerminal("equals_value_clause_variable_declarator_opt");
    internal readonly NonTerminal equals_value_clause_variable_declarator = new NonTerminal("equals_value_clause_variable_declarator");
    internal readonly NonTerminal variable_declarator_value_scc_opt = new NonTerminal("variable_declarator_value_scc_opt");
    internal readonly NonTerminal variable_declarator_value_scc = new NonTerminal("variable_declarator_value_scc");
    internal readonly NonTerminal variable_declarator_value = new NonTerminal("variable_declarator_value");
    //
    internal readonly NonTerminal embedded_statement = new NonTerminal("embedded_statement");
    internal readonly NonTerminal block_opt = new NonTerminal("block_opt");
    internal readonly NonTerminal block = new NonTerminal("block");
    internal readonly NonTerminal empty_statement = new NonTerminal("empty_statement");
    internal readonly NonTerminal expression_statement = new NonTerminal("expression_statement");
    internal readonly NonTerminal statement_expression_sc_opt = new NonTerminal("statement_expression_sc_opt");
    internal readonly NonTerminal statement_expression_sc = new NonTerminal("statement_expression_sc");
    internal readonly NonTerminal statement_expression = new NonTerminal("statement_expression");
    //
    internal readonly NonTerminal selection_statement = new NonTerminal("selection_statement");
    internal readonly NonTerminal if_statement = new NonTerminal("if_statement");
    internal readonly NonTerminal else_clause_opt = new NonTerminal("else_clause_opt");
    internal readonly NonTerminal else_clause = new NonTerminal("else_clause");
    internal readonly NonTerminal switch_statement = new NonTerminal("switch_statement");
    internal readonly NonTerminal switch_section_s_opt = new NonTerminal("switch_section_s_opt");
    internal readonly NonTerminal switch_section_s = new NonTerminal("switch_section_s");
    internal readonly NonTerminal switch_section = new NonTerminal("switch_section");
    internal readonly NonTerminal switch_label_s = new NonTerminal("switch_label_s");
    internal readonly NonTerminal switch_label = new NonTerminal("switch_label");
    internal readonly NonTerminal switch_label_case = new NonTerminal("switch_label_case");
    internal readonly NonTerminal switch_label_default = new NonTerminal("switch_label_default");
    //
    internal readonly NonTerminal iteration_statement = new NonTerminal("iteration_statement");
    internal readonly NonTerminal while_statement = new NonTerminal("while_statement");
    internal readonly NonTerminal do_statement = new NonTerminal("do_statement");
    internal readonly NonTerminal for_statement = new NonTerminal("for_statement");
    internal readonly NonTerminal foreach_statement = new NonTerminal("foreach_statement");
    //
    internal readonly NonTerminal jump_statement = new NonTerminal("jump_statement");
    internal readonly NonTerminal break_statement = new NonTerminal("break_statement");
    internal readonly NonTerminal continue_statement = new NonTerminal("continue_statement");
    internal readonly NonTerminal goto_statement = new NonTerminal("goto_statement");
    internal readonly NonTerminal goto_statement_normal = new NonTerminal("goto_statement_normal");
    internal readonly NonTerminal goto_statement_case = new NonTerminal("goto_statement_case");
    internal readonly NonTerminal goto_statement_default = new NonTerminal("goto_statement_default");
    internal readonly NonTerminal return_statement = new NonTerminal("return_statement");
    internal readonly NonTerminal throw_statement = new NonTerminal("throw_statement");
    //
    internal readonly NonTerminal try_statement = new NonTerminal("try_statement");
    internal readonly NonTerminal catch_clause_s_opt = new NonTerminal("catch_clause_s_opt");
    internal readonly NonTerminal catch_clause_s = new NonTerminal("catch_clause_s");
    internal readonly NonTerminal catch_clause = new NonTerminal("catch_clause");
    internal readonly NonTerminal catch_declaration_opt = new NonTerminal("catch_declaration_opt");
    internal readonly NonTerminal catch_declaration = new NonTerminal("catch_declaration");
    internal readonly NonTerminal finally_clause_opt = new NonTerminal("finally_clause_opt");
    internal readonly NonTerminal finally_clause = new NonTerminal("finally_clause");
    //
    internal readonly NonTerminal checked_statement = new NonTerminal("checked_statement");
    internal readonly NonTerminal unchecked_statement = new NonTerminal("unchecked_statement");
    internal readonly NonTerminal lock_statement = new NonTerminal("lock_statement");
    internal readonly NonTerminal using_statement = new NonTerminal("using_statement");
    internal readonly NonTerminal using_statement_declaration = new NonTerminal("using_statement_declaration");
    internal readonly NonTerminal using_statement_expression = new NonTerminal("using_statement_expression");
    internal readonly NonTerminal yield_statement = new NonTerminal("yield_statement");
    internal readonly NonTerminal yield_statement_return = new NonTerminal("yield_statement_return");
    internal readonly NonTerminal yield_statement_break = new NonTerminal("yield_statement_break");
    //
    internal readonly NonTerminal expression_scc_opt = new NonTerminal("expression_scc_opt");
    internal readonly NonTerminal expression_scc = new NonTerminal("expression_scc");
    internal readonly NonTerminal expression_opt = new NonTerminal("expression_opt");
    internal readonly NonTerminal expression = new NonTerminal("expression");
    internal readonly NonTerminal assignment_expression = new NonTerminal("assignment_expression");
    internal readonly NonTerminal assignment_expression_assign = new NonTerminal("assignment_expression_assign");
    internal readonly NonTerminal assignment_expression_add = new NonTerminal("assignment_expression_add");
    internal readonly NonTerminal assignment_expression_subtract = new NonTerminal("assignment_expression_subtract");
    internal readonly NonTerminal assignment_expression_multiply = new NonTerminal("assignment_expression_multiply");
    internal readonly NonTerminal assignment_expression_divide = new NonTerminal("assignment_expression_divide");
    internal readonly NonTerminal assignment_expression_modulo = new NonTerminal("assignment_expression_modulo");
    internal readonly NonTerminal assignment_expression_and = new NonTerminal("assignment_expression_and");
    internal readonly NonTerminal assignment_expression_exclusive_or = new NonTerminal("assignment_expression_exclusive_or");
    internal readonly NonTerminal assignment_expression_or = new NonTerminal("assignment_expression_or");
    internal readonly NonTerminal assignment_expression_left_shift = new NonTerminal("assignment_expression_left_shift");
    internal readonly NonTerminal assignment_expression_right_shift = new NonTerminal("assignment_expression_right_shift");
    //
    internal readonly NonTerminal non_assignment_expression = new NonTerminal("non_assignment_expression");
    internal readonly NonTerminal lambda_expression = new NonTerminal("lambda_expression");
    internal readonly NonTerminal simple_lambda_expression = new NonTerminal("simple_lambda_expression");
    internal readonly NonTerminal parenthesized_lambda_expression = new NonTerminal("parenthesized_lambda_expression");
    internal readonly NonTerminal lambda_body = new NonTerminal("lambda_body");
    //internal readonly NonTerminal _expression = new NonTerminal("_expression");
    internal readonly NonTerminal conditional_expression = new NonTerminal("conditional_expression");
    internal readonly NonTerminal conditional_expression_main = new NonTerminal("conditional_expression_main");
    internal readonly NonTerminal coalescing_expression = new NonTerminal("coalescing_expression");
    internal readonly NonTerminal coalescing_expression_main = new NonTerminal("coalescing_expression_main");
    internal readonly NonTerminal logical_or_expression = new NonTerminal("logical_or_expression");
    internal readonly NonTerminal logical_or_expression_main = new NonTerminal("logical_or_expression_main");
    internal readonly NonTerminal logical_and_expression = new NonTerminal("logical_and_expression");
    internal readonly NonTerminal logical_and_expression_main = new NonTerminal("logical_and_expression_main");
    internal readonly NonTerminal bitwise_or_expression = new NonTerminal("bitwise_or_expression");
    internal readonly NonTerminal bitwise_or_expression_main = new NonTerminal("bitwise_or_expression_main");
    internal readonly NonTerminal exclusive_or_expression = new NonTerminal("exclusive_or_expression");
    internal readonly NonTerminal exclusive_or_expression_main = new NonTerminal("exclusive_or_expression_main");
    internal readonly NonTerminal bitwise_and_expression = new NonTerminal("bitwise_and_expression");
    internal readonly NonTerminal bitwise_and_expression_main = new NonTerminal("bitwise_and_expression_main");
    internal readonly NonTerminal equality_expression = new NonTerminal("equality_expression");
    internal readonly NonTerminal equality_expression_equals = new NonTerminal("equality_expression_equals");
    internal readonly NonTerminal equality_expression_not_equals = new NonTerminal("equality_expression_not_equals");
    internal readonly NonTerminal relational_expression = new NonTerminal("relational_expression");
    internal readonly NonTerminal relational_expression_less_than = new NonTerminal("relational_expression_less_than");
    internal readonly NonTerminal relational_expression_less_than_or_equal = new NonTerminal("relational_expression_less_than_or_equal");
    internal readonly NonTerminal relational_expression_greater_than = new NonTerminal("relational_expression_greater_than");
    internal readonly NonTerminal relational_expression_greater_than_or_equal = new NonTerminal("relational_expression_greater_than_or_equal");
    internal readonly NonTerminal relational_expression_is = new NonTerminal("relational_expression_is");
    internal readonly NonTerminal relational_expression_as = new NonTerminal("relational_expression_as");
    internal readonly NonTerminal shift_expression = new NonTerminal("shift_expression");
    internal readonly NonTerminal shift_expression_left = new NonTerminal("shift_expression_left");
    internal readonly NonTerminal shift_expression_right = new NonTerminal("shift_expression_right");
    internal readonly NonTerminal additive_expression = new NonTerminal("additive_expression");
    internal readonly NonTerminal additive_expression_add = new NonTerminal("additive_expression_add");
    internal readonly NonTerminal additive_expression_subtract = new NonTerminal("additive_expression_subtract");
    internal readonly NonTerminal multiplicative_expression = new NonTerminal("multiplicative_expression");
    internal readonly NonTerminal multiplicative_expression_multiply = new NonTerminal("multiplicative_expression_multiply");
    internal readonly NonTerminal multiplicative_expression_divide = new NonTerminal("multiplicative_expression_divide");
    internal readonly NonTerminal multiplicative_expression_modulo = new NonTerminal("multiplicative_expression_modulo");
    internal readonly NonTerminal prefix_unary_expression = new NonTerminal("prefix_unary_expression");
    internal readonly NonTerminal prefix_unary_expression_plus = new NonTerminal("prefix_unary_expression_plus");
    internal readonly NonTerminal prefix_unary_expression_negate = new NonTerminal("prefix_unary_expression_negate");
    internal readonly NonTerminal prefix_unary_expression_logical_not = new NonTerminal("prefix_unary_expression_logical_not");
    internal readonly NonTerminal prefix_unary_expression_bitwise_not = new NonTerminal("prefix_unary_expression_bitwise_not");
    internal readonly NonTerminal prefix_unary_expression_pre_increment = new NonTerminal("prefix_unary_expression_pre_increment");
    internal readonly NonTerminal prefix_unary_expression_pre_decrement = new NonTerminal("prefix_unary_expression_pre_decrement");
    internal readonly NonTerminal prefix_unary_expression_cast = new NonTerminal("prefix_unary_expression_cast");
    internal readonly NonTerminal primary_expression = new NonTerminal("primary_expression");
    internal readonly NonTerminal parenthesized_expression = new NonTerminal("parenthesized_expression");
    internal readonly NonTerminal literal_expression = new NonTerminal("literal_expression");
    internal readonly NonTerminal literal_expression_true = new NonTerminal("literal_expression_true");
    internal readonly NonTerminal literal_expression_false = new NonTerminal("literal_expression_false");
    internal readonly NonTerminal literal_expression_null = new NonTerminal("literal_expression_null");
    internal readonly NonTerminal literal_expression_numeric_literal = new NonTerminal("literal_expression_numeric_literal");
    internal readonly NonTerminal literal_expression_character_literal = new NonTerminal("literal_expression_character_literal");
    internal readonly NonTerminal literal_expression_string_literal = new NonTerminal("literal_expression_string_literal");
    internal readonly NonTerminal this_expression = new NonTerminal("this_expression");
    internal readonly NonTerminal base_expression = new NonTerminal("base_expression");
    internal readonly NonTerminal postfix_unary_expression = new NonTerminal("postfix_unary_expression");
    internal readonly NonTerminal postfix_unary_expression_increment = new NonTerminal("postfix_unary_expression_increment");
    internal readonly NonTerminal postfix_unary_expression_decrement = new NonTerminal("postfix_unary_expression_decrement");
    internal readonly NonTerminal typeof_expression = new NonTerminal("typeof_expression");
    internal readonly NonTerminal checked_expression = new NonTerminal("checked_expression");
    internal readonly NonTerminal checked_expression_checked = new NonTerminal("checked_expression_checked");
    internal readonly NonTerminal checked_expression_unchecked = new NonTerminal("checked_expression_unchecked");
    internal readonly NonTerminal default_expression = new NonTerminal("default_expression");
    internal readonly NonTerminal member_access_expression = new NonTerminal("member_access_expression");
    internal readonly NonTerminal element_access_expression = new NonTerminal("element_access_expression");
    internal readonly NonTerminal invocation_expression = new NonTerminal("invocation_expression");
    internal readonly NonTerminal anonymous_method_expression = new NonTerminal("anonymous_method_expression");
    internal readonly NonTerminal object_creation_expression = new NonTerminal("object_creation_expression");
    internal readonly NonTerminal array_creation_expression = new NonTerminal("array_creation_expression");
    internal readonly NonTerminal implicit_array_creation_expression = new NonTerminal("implicit_array_creation_expression");
    internal readonly NonTerminal anonymous_object_creation_expression = new NonTerminal("anonymous_object_creation_expression");
    internal readonly NonTerminal anonymous_object_member_declarator_scc_opt = new NonTerminal("anonymous_object_member_declarator_scc_opt");
    internal readonly NonTerminal anonymous_object_member_declarator_scc = new NonTerminal("anonymous_object_member_declarator_scc");
    internal readonly NonTerminal anonymous_object_member_declarator = new NonTerminal("anonymous_object_member_declarator");
    //internal readonly NonTerminal  = new NonTerminal("");
    //internal readonly NonTerminal  = new NonTerminal("");
    internal readonly NonTerminal object_or_collection_initializer_opt = new NonTerminal("object_or_collection_initializer_opt");
    internal readonly NonTerminal object_or_collection_initializer = new NonTerminal("object_or_collection_initializer");
    internal readonly NonTerminal object_initializer = new NonTerminal("object_initializer");
    internal readonly NonTerminal object_member_initializer_scc_opt = new NonTerminal("object_member_initializer_scc_opt");
    internal readonly NonTerminal object_member_initializer_scc = new NonTerminal("object_member_initializer_scc");
    internal readonly NonTerminal object_member_initializer = new NonTerminal("object_member_initializer");
    internal readonly NonTerminal object_member_initializer_value = new NonTerminal("object_member_initializer_value");
    internal readonly NonTerminal collection_initializer = new NonTerminal("collection_initializer");
    internal readonly NonTerminal collection_element_initializer_scc_opt = new NonTerminal("collection_element_initializer_scc_opt");
    internal readonly NonTerminal collection_element_initializer_scc = new NonTerminal("collection_element_initializer_scc");
    internal readonly NonTerminal collection_element_initializer = new NonTerminal("collection_element_initializer");
    internal readonly NonTerminal complex_element_initializer = new NonTerminal("complex_element_initializer");
    internal readonly NonTerminal array_initializer_opt = new NonTerminal("array_initializer_opt");
    internal readonly NonTerminal array_initializer = new NonTerminal("array_initializer");
    //internal readonly NonTerminal  = new NonTerminal("");
    internal readonly NonTerminal query_expression = new NonTerminal("query_expression");
    internal readonly NonTerminal from_clause = new NonTerminal("from_clause");
    internal readonly NonTerminal query_body = new NonTerminal("query_body");
    internal readonly NonTerminal query_body_clause_s_opt = new NonTerminal("query_body_clause_s_opt");
    internal readonly NonTerminal query_body_clause_s = new NonTerminal("query_body_clause_s");
    internal readonly NonTerminal query_body_clause = new NonTerminal("query_body_clause");
    internal readonly NonTerminal let_clause = new NonTerminal("let_clause");
    internal readonly NonTerminal join_clause = new NonTerminal("join_clause");
    internal readonly NonTerminal join_into_clause_opt = new NonTerminal("join_into_clause_opt");
    internal readonly NonTerminal join_into_clause = new NonTerminal("join_into_clause");
    internal readonly NonTerminal where_clause = new NonTerminal("where_clause");
    internal readonly NonTerminal orderby_clause = new NonTerminal("orderby_clause");
    internal readonly NonTerminal ordering_sc = new NonTerminal("ordering_sc");
    internal readonly NonTerminal ordering = new NonTerminal("ordering");
    internal readonly NonTerminal ordering_ascending = new NonTerminal("ordering_ascending");
    internal readonly NonTerminal ordering_descending = new NonTerminal("ordering_descending");
    internal readonly NonTerminal ascending_keyword_opt = new NonTerminal("ascending_keyword_opt");
    internal readonly NonTerminal select_or_group_clause = new NonTerminal("select_or_group_clause");
    internal readonly NonTerminal select_clause = new NonTerminal("select_clause");
    internal readonly NonTerminal group_clause = new NonTerminal("group_clause");
    internal readonly NonTerminal query_continuation_opt = new NonTerminal("query_continuation_opt");
    internal readonly NonTerminal query_continuation = new NonTerminal("query_continuation");
    //internal readonly NonTerminal  = new NonTerminal("");
    internal readonly NonTerminal type_sc = new NonTerminal("type_sc");
    internal readonly NonTerminal type_opt = new NonTerminal("type_opt");
    internal readonly NonTerminal type = new NonTerminal("type");
    internal readonly NonTerminal non_array_type = new NonTerminal("non_array_type");
    internal readonly NonTerminal nullable_type = new NonTerminal("nullable_type");
    internal readonly NonTerminal predefined_type = new NonTerminal("predefined_type");
    internal readonly NonTerminal predefined_type_keyword = new NonTerminal("predefined_type_keyword");
    internal readonly NonTerminal array_type = new NonTerminal("array_type");
    internal readonly NonTerminal array_rank_specifier_s = new NonTerminal("array_rank_specifier_s");
    internal readonly NonTerminal array_rank_specifier = new NonTerminal("array_rank_specifier");
    internal readonly NonTerminal array_rank_specifier_sizes = new NonTerminal("array_rank_specifier_sizes");
    internal readonly NonTerminal array_rank_specifier_sizes_omitted = new NonTerminal("array_rank_specifier_sizes_omitted");
    internal readonly NonTerminal array_rank_specifier_sizes_separated = new NonTerminal("array_rank_specifier_sizes_separated");
    //
    internal readonly NonTerminal name = new NonTerminal("name");
    internal readonly NonTerminal simple_name = new NonTerminal("simple_name");
    internal readonly NonTerminal identifier_name = new NonTerminal("identifier_name");
    internal readonly NonTerminal generic_name = new NonTerminal("generic_name");
    internal readonly NonTerminal qualified_name = new NonTerminal("qualified_name");
    internal readonly NonTerminal alias_qualified_name = new NonTerminal("alias_qualified_name");
    internal readonly NonTerminal alias_qualified_name_alias = new NonTerminal("alias_qualified_name_alias");
    //
    internal readonly NonTerminal global_keyword_identifier_name = new NonTerminal("global_keyword_identifier_name");
    internal readonly NonTerminal comma_token_s_opt = new NonTerminal("comma_token_s_opt");
    internal readonly NonTerminal comma_token_s = new NonTerminal("comma_token_s");
    internal readonly NonTerminal semicolon_token_opt = new NonTerminal("semicolon_token_opt");
    internal readonly NonTerminal identifier_token_opt = new NonTerminal("identifier_token_opt");
    //internal readonly NonTerminal  = new NonTerminal("");
    //internal readonly NonTerminal  = new NonTerminal("");
    //internal readonly NonTerminal  = new NonTerminal("");
    //internal readonly NonTerminal  = new NonTerminal("");

    public CSGrammar()
    {
        NonGrammarTerminals.Add(SingleLineComment);
        NonGrammarTerminals.Add(DelimitedComment);
        #region tokens
        TildeToken = __CreateToken(SyntaxKind.TildeToken);// ~
        ExclamationToken = __CreateToken(SyntaxKind.ExclamationToken);// !
        DollarToken = __CreateToken(SyntaxKind.DollarToken);// $
        PercentToken = __CreateToken(SyntaxKind.PercentToken);// %
        CaretToken = __CreateToken(SyntaxKind.CaretToken);// ^
        AmpersandToken = __CreateToken(SyntaxKind.AmpersandToken);// &
        AsteriskToken = __CreateToken(SyntaxKind.AsteriskToken);// *
        OpenParenToken = __CreateToken(SyntaxKind.OpenParenToken);// (
        CloseParenToken = __CreateToken(SyntaxKind.CloseParenToken);// )
        MinusToken = __CreateToken(SyntaxKind.MinusToken);// -
        PlusToken = __CreateToken(SyntaxKind.PlusToken);// +
        EqualsToken = __CreateToken(SyntaxKind.EqualsToken);// =
        OpenBraceToken = __CreateToken(SyntaxKind.OpenBraceToken);// {
        CloseBraceToken = __CreateToken(SyntaxKind.CloseBraceToken);// }
        OpenBracketToken = __CreateToken(SyntaxKind.OpenBracketToken);// [
        CloseBracketToken = __CreateToken(SyntaxKind.CloseBracketToken);// ]
        BarToken = __CreateToken(SyntaxKind.BarToken);// |
        BackslashToken = __CreateToken(SyntaxKind.BackslashToken);// \
        ColonToken = __CreateToken(SyntaxKind.ColonToken);// :
        SemicolonToken = __CreateToken(SyntaxKind.SemicolonToken);// ;
        DoubleQuoteToken = __CreateToken(SyntaxKind.DoubleQuoteToken);// "
        SingleQuoteToken = __CreateToken(SyntaxKind.SingleQuoteToken);// '
        LessThanToken = __CreateToken(SyntaxKind.LessThanToken);// <
        CommaToken = __CreateToken(SyntaxKind.CommaToken);// ,
        GreaterThanToken = __CreateToken(SyntaxKind.GreaterThanToken);// >
        DotToken = __CreateToken(SyntaxKind.DotToken);// .
        QuestionToken = __CreateToken(SyntaxKind.QuestionToken);// ?
        HashToken = __CreateToken(SyntaxKind.HashToken);// #
        SlashToken = __CreateToken(SyntaxKind.SlashToken);// /
        SlashGreaterThanToken = __CreateToken(SyntaxKind.SlashGreaterThanToken);// />
        LessThanSlashToken = __CreateToken(SyntaxKind.LessThanSlashToken);// </
        XmlCommentStartToken = __CreateToken(SyntaxKind.XmlCommentStartToken);// <!--
        XmlCommentEndToken = __CreateToken(SyntaxKind.XmlCommentEndToken);// -->
        XmlCDataStartToken = __CreateToken(SyntaxKind.XmlCDataStartToken);// <![CDATA[
        XmlCDataEndToken = __CreateToken(SyntaxKind.XmlCDataEndToken);// ]]>
        XmlProcessingInstructionStartToken = __CreateToken(SyntaxKind.XmlProcessingInstructionStartToken);// <?
        XmlProcessingInstructionEndToken = __CreateToken(SyntaxKind.XmlProcessingInstructionEndToken);// ?>
        BarBarToken = __CreateToken(SyntaxKind.BarBarToken);// ||
        AmpersandAmpersandToken = __CreateToken(SyntaxKind.AmpersandAmpersandToken);// &&
        MinusMinusToken = __CreateToken(SyntaxKind.MinusMinusToken);// --
        PlusPlusToken = __CreateToken(SyntaxKind.PlusPlusToken);// ++
        ColonColonToken = __CreateToken(SyntaxKind.ColonColonToken);// ::
        QuestionQuestionToken = __CreateToken(SyntaxKind.QuestionQuestionToken);// ??
        MinusGreaterThanToken = __CreateToken(SyntaxKind.MinusGreaterThanToken);// ->
        ExclamationEqualsToken = __CreateToken(SyntaxKind.ExclamationEqualsToken);// !=
        EqualsEqualsToken = __CreateToken(SyntaxKind.EqualsEqualsToken);// ==
        EqualsGreaterThanToken = __CreateToken(SyntaxKind.EqualsGreaterThanToken);// =>
        LessThanEqualsToken = __CreateToken(SyntaxKind.LessThanEqualsToken);// <=
        LessThanLessThanToken = __CreateToken(SyntaxKind.LessThanLessThanToken);// <<
        LessThanLessThanEqualsToken = __CreateToken(SyntaxKind.LessThanLessThanEqualsToken);// <<=
        GreaterThanEqualsToken = __CreateToken(SyntaxKind.GreaterThanEqualsToken);// >=
        GreaterThanGreaterThanToken = __CreateToken(SyntaxKind.GreaterThanGreaterThanToken);// >>
        GreaterThanGreaterThanEqualsToken = __CreateToken(SyntaxKind.GreaterThanGreaterThanEqualsToken);// >>=
        SlashEqualsToken = __CreateToken(SyntaxKind.SlashEqualsToken);// /=
        AsteriskEqualsToken = __CreateToken(SyntaxKind.AsteriskEqualsToken);// *=
        BarEqualsToken = __CreateToken(SyntaxKind.BarEqualsToken);// |=
        AmpersandEqualsToken = __CreateToken(SyntaxKind.AmpersandEqualsToken);// &=
        PlusEqualsToken = __CreateToken(SyntaxKind.PlusEqualsToken);// +=
        MinusEqualsToken = __CreateToken(SyntaxKind.MinusEqualsToken);// -=
        CaretEqualsToken = __CreateToken(SyntaxKind.CaretEqualsToken);// ^=
        PercentEqualsToken = __CreateToken(SyntaxKind.PercentEqualsToken);// %=
        BoolKeyword = __CreateToken(SyntaxKind.BoolKeyword);// bool
        ByteKeyword = __CreateToken(SyntaxKind.ByteKeyword);// byte
        SByteKeyword = __CreateToken(SyntaxKind.SByteKeyword);// sbyte
        ShortKeyword = __CreateToken(SyntaxKind.ShortKeyword);// short
        UShortKeyword = __CreateToken(SyntaxKind.UShortKeyword);// ushort
        IntKeyword = __CreateToken(SyntaxKind.IntKeyword);// int
        UIntKeyword = __CreateToken(SyntaxKind.UIntKeyword);// uint
        LongKeyword = __CreateToken(SyntaxKind.LongKeyword);// long
        ULongKeyword = __CreateToken(SyntaxKind.ULongKeyword);// ulong
        DoubleKeyword = __CreateToken(SyntaxKind.DoubleKeyword);// double
        FloatKeyword = __CreateToken(SyntaxKind.FloatKeyword);// float
        DecimalKeyword = __CreateToken(SyntaxKind.DecimalKeyword);// decimal
        StringKeyword = __CreateToken(SyntaxKind.StringKeyword);// string
        CharKeyword = __CreateToken(SyntaxKind.CharKeyword);// char
        VoidKeyword = __CreateToken(SyntaxKind.VoidKeyword);// void
        ObjectKeyword = __CreateToken(SyntaxKind.ObjectKeyword);// object
        TypeOfKeyword = __CreateToken(SyntaxKind.TypeOfKeyword);// typeof
        SizeOfKeyword = __CreateToken(SyntaxKind.SizeOfKeyword);// sizeof
        NullKeyword = __CreateToken(SyntaxKind.NullKeyword);// null
        TrueKeyword = __CreateToken(SyntaxKind.TrueKeyword);// true
        FalseKeyword = __CreateToken(SyntaxKind.FalseKeyword);// false
        IfKeyword = __CreateToken(SyntaxKind.IfKeyword);// if
        ElseKeyword = __CreateToken(SyntaxKind.ElseKeyword);// else
        WhileKeyword = __CreateToken(SyntaxKind.WhileKeyword);// while
        ForKeyword = __CreateToken(SyntaxKind.ForKeyword);// for
        ForEachKeyword = __CreateToken(SyntaxKind.ForEachKeyword);// foreach
        DoKeyword = __CreateToken(SyntaxKind.DoKeyword);// do
        SwitchKeyword = __CreateToken(SyntaxKind.SwitchKeyword);// switch
        CaseKeyword = __CreateToken(SyntaxKind.CaseKeyword);// case
        DefaultKeyword = __CreateToken(SyntaxKind.DefaultKeyword);// default
        TryKeyword = __CreateToken(SyntaxKind.TryKeyword);// try
        CatchKeyword = __CreateToken(SyntaxKind.CatchKeyword);// catch
        FinallyKeyword = __CreateToken(SyntaxKind.FinallyKeyword);// finally
        LockKeyword = __CreateToken(SyntaxKind.LockKeyword);// lock
        GotoKeyword = __CreateToken(SyntaxKind.GotoKeyword);// goto
        BreakKeyword = __CreateToken(SyntaxKind.BreakKeyword);// break
        ContinueKeyword = __CreateToken(SyntaxKind.ContinueKeyword);// continue
        ReturnKeyword = __CreateToken(SyntaxKind.ReturnKeyword);// return
        ThrowKeyword = __CreateToken(SyntaxKind.ThrowKeyword);// throw
        PublicKeyword = __CreateToken(SyntaxKind.PublicKeyword);// public
        PrivateKeyword = __CreateToken(SyntaxKind.PrivateKeyword);// private
        InternalKeyword = __CreateToken(SyntaxKind.InternalKeyword);// internal
        ProtectedKeyword = __CreateToken(SyntaxKind.ProtectedKeyword);// protected
        StaticKeyword = __CreateToken(SyntaxKind.StaticKeyword);// static
        ReadOnlyKeyword = __CreateToken(SyntaxKind.ReadOnlyKeyword);// readonly
        SealedKeyword = __CreateToken(SyntaxKind.SealedKeyword);// sealed
        ConstKeyword = __CreateToken(SyntaxKind.ConstKeyword);// const
        FixedKeyword = __CreateToken(SyntaxKind.FixedKeyword);// fixed
        StackAllocKeyword = __CreateToken(SyntaxKind.StackAllocKeyword);// stackalloc
        VolatileKeyword = __CreateToken(SyntaxKind.VolatileKeyword);// volatile
        NewKeyword = __CreateToken(SyntaxKind.NewKeyword);// new
        OverrideKeyword = __CreateToken(SyntaxKind.OverrideKeyword);// override
        AbstractKeyword = __CreateToken(SyntaxKind.AbstractKeyword);// abstract
        VirtualKeyword = __CreateToken(SyntaxKind.VirtualKeyword);// virtual
        EventKeyword = __CreateToken(SyntaxKind.EventKeyword);// event
        ExternKeyword = __CreateToken(SyntaxKind.ExternKeyword);// extern
        RefKeyword = __CreateToken(SyntaxKind.RefKeyword);// ref
        OutKeyword = __CreateToken(SyntaxKind.OutKeyword);// out
        InKeyword = __CreateToken(SyntaxKind.InKeyword);// in
        IsKeyword = __CreateToken(SyntaxKind.IsKeyword);// is
        AsKeyword = __CreateToken(SyntaxKind.AsKeyword);// as
        ParamsKeyword = __CreateToken(SyntaxKind.ParamsKeyword);// params
        ArgListKeyword = __CreateToken(SyntaxKind.ArgListKeyword);// __arglist
        MakeRefKeyword = __CreateToken(SyntaxKind.MakeRefKeyword);// __makeref
        RefTypeKeyword = __CreateToken(SyntaxKind.RefTypeKeyword);// __reftype
        RefValueKeyword = __CreateToken(SyntaxKind.RefValueKeyword);// __refvalue
        ThisKeyword = __CreateToken(SyntaxKind.ThisKeyword);// this
        BaseKeyword = __CreateToken(SyntaxKind.BaseKeyword);// base
        NamespaceKeyword = __CreateToken(SyntaxKind.NamespaceKeyword);// namespace
        UsingKeyword = __CreateToken(SyntaxKind.UsingKeyword);// using
        ClassKeyword = __CreateToken(SyntaxKind.ClassKeyword);// class
        StructKeyword = __CreateToken(SyntaxKind.StructKeyword);// struct
        InterfaceKeyword = __CreateToken(SyntaxKind.InterfaceKeyword);// interface
        EnumKeyword = __CreateToken(SyntaxKind.EnumKeyword);// enum
        DelegateKeyword = __CreateToken(SyntaxKind.DelegateKeyword);// delegate
        CheckedKeyword = __CreateToken(SyntaxKind.CheckedKeyword);// checked
        UncheckedKeyword = __CreateToken(SyntaxKind.UncheckedKeyword);// unchecked
        UnsafeKeyword = __CreateToken(SyntaxKind.UnsafeKeyword);// unsafe
        OperatorKeyword = __CreateToken(SyntaxKind.OperatorKeyword);// operator
        ExplicitKeyword = __CreateToken(SyntaxKind.ExplicitKeyword);// explicit
        ImplicitKeyword = __CreateToken(SyntaxKind.ImplicitKeyword);// implicit
        YieldKeyword = __CreateToken(SyntaxKind.YieldKeyword);// yield
        PartialKeyword = __CreateToken(SyntaxKind.PartialKeyword);// partial
        AliasKeyword = __CreateToken(SyntaxKind.AliasKeyword);// alias
        GlobalKeyword = __CreateToken(SyntaxKind.GlobalKeyword);// global
        AssemblyKeyword = __CreateToken(SyntaxKind.AssemblyKeyword);// assembly
        ModuleKeyword = __CreateToken(SyntaxKind.ModuleKeyword);// module
        TypeKeyword = __CreateToken(SyntaxKind.TypeKeyword);// type
        FieldKeyword = __CreateToken(SyntaxKind.FieldKeyword);// field
        MethodKeyword = __CreateToken(SyntaxKind.MethodKeyword);// method
        ParamKeyword = __CreateToken(SyntaxKind.ParamKeyword);// param
        PropertyKeyword = __CreateToken(SyntaxKind.PropertyKeyword);// property
        TypeVarKeyword = __CreateToken(SyntaxKind.TypeVarKeyword);// typevar
        GetKeyword = __CreateToken(SyntaxKind.GetKeyword);// get
        SetKeyword = __CreateToken(SyntaxKind.SetKeyword);// set
        AddKeyword = __CreateToken(SyntaxKind.AddKeyword);// add
        RemoveKeyword = __CreateToken(SyntaxKind.RemoveKeyword);// remove
        WhereKeyword = __CreateToken(SyntaxKind.WhereKeyword);// where
        FromKeyword = __CreateToken(SyntaxKind.FromKeyword);// from
        GroupKeyword = __CreateToken(SyntaxKind.GroupKeyword);// group
        JoinKeyword = __CreateToken(SyntaxKind.JoinKeyword);// join
        IntoKeyword = __CreateToken(SyntaxKind.IntoKeyword);// into
        LetKeyword = __CreateToken(SyntaxKind.LetKeyword);// let
        ByKeyword = __CreateToken(SyntaxKind.ByKeyword);// by
        SelectKeyword = __CreateToken(SyntaxKind.SelectKeyword);// select
        OrderByKeyword = __CreateToken(SyntaxKind.OrderByKeyword);// orderby
        OnKeyword = __CreateToken(SyntaxKind.OnKeyword);// on
        EqualsKeyword = __CreateToken(SyntaxKind.EqualsKeyword);// equals
        AscendingKeyword = __CreateToken(SyntaxKind.AscendingKeyword);// ascending
        DescendingKeyword = __CreateToken(SyntaxKind.DescendingKeyword);// descending
        AsyncKeyword = __CreateToken(SyntaxKind.AsyncKeyword);// async
        AwaitKeyword = __CreateToken(SyntaxKind.AwaitKeyword);// await
        ElifKeyword = __CreateToken(SyntaxKind.ElifKeyword);// elif
        EndIfKeyword = __CreateToken(SyntaxKind.EndIfKeyword);// endif
        RegionKeyword = __CreateToken(SyntaxKind.RegionKeyword);// region
        EndRegionKeyword = __CreateToken(SyntaxKind.EndRegionKeyword);// endregion
        DefineKeyword = __CreateToken(SyntaxKind.DefineKeyword);// define
        UndefKeyword = __CreateToken(SyntaxKind.UndefKeyword);// undef
        WarningKeyword = __CreateToken(SyntaxKind.WarningKeyword);// warning
        ErrorKeyword = __CreateToken(SyntaxKind.ErrorKeyword);// error
        LineKeyword = __CreateToken(SyntaxKind.LineKeyword);// line
        PragmaKeyword = __CreateToken(SyntaxKind.PragmaKeyword);// pragma
        HiddenKeyword = __CreateToken(SyntaxKind.HiddenKeyword);// hidden
        ChecksumKeyword = __CreateToken(SyntaxKind.ChecksumKeyword);// checksum
        DisableKeyword = __CreateToken(SyntaxKind.DisableKeyword);// disable
        RestoreKeyword = __CreateToken(SyntaxKind.RestoreKeyword);// restore
        ReferenceKeyword = __CreateToken(SyntaxKind.ReferenceKeyword);// r
        #endregion tokens
        //
        this.Root = compilation_unit;
        compilation_unit.Seq(extern_alias_directive_s_opt, using_directive_s_opt, global_attribute_list_s_opt, global_namespace_member_s_opt)
            .ProjectStruct("_CompilationUnit", i0n("Externs"), i1n("Usings"), i2n("AttributeLists"), i3n("Members"));
        //
        extern_alias_directive_s_opt.ListOpt(extern_alias_directive_s);
        extern_alias_directive_s.List(extern_alias_directive);
        extern_alias_directive.Seq(PreferShiftHere(), ExternKeyword, AliasKeyword, IdentifierToken, SemicolonToken)
            .ProjectStruct("_ExternAliasDirective", i0n("ExternKeyword"), i1n("AliasKeyword"), i2n("Identifier"), i3n("SemicolonToken"));
        //
        using_directive_s_opt.ListOpt(using_directive_s);
        using_directive_s.List(using_directive);
        using_directive.Choice(using_directive_alias, using_directive_namespace);
        using_directive_alias.Seq(UsingKeyword, name_equals, name, SemicolonToken)
            .ProjectStruct("_UsingDirective", i0n("UsingKeyword"), i1n("Alias"), i2n("Name"), i3n("SemicolonToken"));
        using_directive_namespace.Seq(UsingKeyword, name, SemicolonToken)
            .ProjectStruct("_UsingDirective", i0n("UsingKeyword"), Node.Null("Alias"), i1n("Name"), i2n("SemicolonToken"));
        //
        global_attribute_list_s_opt.ListOpt(global_attribute_list_s);
        global_attribute_list_s.List(global_attribute_list);
        global_attribute_list.Seq(PreferShiftHere(), OpenBracketToken, global_attribute_target_specifier, attribute_scc, CloseBracketToken)
            .ProjectStruct("_AttributeList", i0n("OpenBracketToken"), i1n("Target"), i2n("Attributes"), i3n("CloseBracketToken"));
        global_attribute_target_specifier.Seq(global_attribute_target_specifier_identifier, ColonToken)
            .ProjectStruct("_AttributeTargetSpecifier", i0n("Identifier"), i1n("ColonToken"));
        global_attribute_target_specifier_identifier.Choice(AssemblyKeyword, ModuleKeyword);
        //
        attribute_list_s_opt.ListOpt(attribute_list_s);
        attribute_list_s.List(attribute_list);
        attribute_list.Seq(OpenBracketToken, attribute_target_specifier_opt, attribute_scc, CloseBracketToken)
            .ProjectStruct("_AttributeList", i0n("OpenBracketToken"), i1n("Target"), i2n("Attributes"), i3n("CloseBracketToken"));
        attribute_target_specifier_opt.Opt(attribute_target_specifier);
        attribute_target_specifier.Seq(attribute_target_specifier_identifier, ColonToken)
            .ProjectStruct("_AttributeTargetSpecifier", i0n("Identifier"), i1n("ColonToken"));
        attribute_target_specifier_identifier.Choice(FieldKeyword, MethodKeyword, ParamKeyword, PropertyKeyword, ReturnKeyword, TypeKeyword);
        //
        attribute_scc.SeparatedList(CommaToken, attribute, true);
        attribute.Seq(name, attribute_argument_list_opt)
            .ProjectStruct("_Attribute", i0n("Name"), i1n("ArgumentList"));
        attribute_argument_list_opt.Opt(attribute_argument_list);
        attribute_argument_list.Seq(OpenParenToken, attribute_argument_sc_opt, CloseParenToken)
            .ProjectStruct("_AttributeArgumentList", i0n("OpenParenToken"), i1n("Arguments"), i2n("CloseParenToken"));
        attribute_argument_sc_opt.ListOpt(attribute_argument_sc);
        attribute_argument_sc.SeparatedList(CommaToken, attribute_argument, false);
        attribute_argument.Choice(attribute_argument_name_equals, attribute_argument_name_colon, attribute_argument_expression);
        attribute_argument_name_equals.Seq(name_equals, expression)
            .ProjectStruct("_AttributeArgument", i0n("NameEquals"), Node.Null("NameColon"), i1n("Expression"));
        attribute_argument_name_colon.Seq(name_colon, expression)
            .ProjectStruct("_AttributeArgument", Node.Null("NameEquals"), i0n("NameColon"), i1n("Expression"));
        attribute_argument_expression.Seq(expression)
            .ProjectStruct("_AttributeArgument", Node.Null("NameEquals"), Node.Null("NameColon"), i0n("Expression"));
        //
        global_namespace_member_s_opt.ListOpt(global_namespace_member_s);
        global_namespace_member_s.List(global_namespace_member);
        global_namespace_member.Choice(namespace_declaration, type_declaration);
        var __nsAnns = __GetNamespaceAnnotations();
        if (__nsAnns == null)
            namespace_declaration.Seq(NamespaceKeyword, name, OpenBraceToken, extern_alias_directive_s_opt, namespace_prolog_s_opt, namespace_member_s_opt, CloseBraceToken, semicolon_token_opt)
                .ProjectStruct("_NamespaceDeclaration", i0n("NamespaceKeyword"), i1n("Name"), i2n("OpenBraceToken"), i3n("Externs"), i4n("Usings"), i5n("Members"), i6n("CloseBraceToken"), i7n("SemicolonToken"));
        else
            namespace_declaration.Seq(__nsAnns, NamespaceKeyword, name, OpenBraceToken, extern_alias_directive_s_opt, namespace_prolog_s_opt, namespace_member_s_opt, CloseBraceToken, semicolon_token_opt)
                .ProjectStruct("_NamespaceDeclaration", i0n("Annotations"), i1n("NamespaceKeyword"), i2n("Name"), i3n("OpenBraceToken"), i4n("Externs"), i5n("Usings"), i6n("Members"), i7n("CloseBraceToken"), i8n("SemicolonToken"));
        namespace_prolog_s_opt.ListOpt(namespace_prolog_s);
        namespace_prolog_s.List(namespace_prolog);
        namespace_prolog.Choice(using_directive);
        namespace_prolog.AppendChoice(__GetNamespaceProlog());
        namespace_member_s_opt.ListOpt(namespace_member_s);
        namespace_member_s.List(namespace_member);
        namespace_member.Choice(global_namespace_member);
        namespace_member.AppendChoice(__GetNamespaceMember());
        //
        accessibility_element.Choice(PublicKeyword, ProtectedKeyword, InternalKeyword, PrivateKeyword);
        modifier_s_opt.ListOpt(modifier_s);
        modifier_s.List(modifier);
        modifier.Choice(accessibility_element, NewKeyword, StaticKeyword, VirtualKeyword, SealedKeyword, OverrideKeyword,
            AbstractKeyword, ExternKeyword, PartialKeyword, ReadOnlyKeyword, VolatileKeyword, ConstKeyword);
        //
        type_declaration.Choice(class_declaration, struct_declaration, interface_declaration, enum_declaration, delegate_declaration);
        delegate_declaration.Seq(attribute_list_s_opt, modifier_s_opt, DelegateKeyword, type, IdentifierToken, type_parameter_list_opt, parameter_list, type_parameter_constraint_clause_s_opt, SemicolonToken)
            .ProjectStruct("_DelegateDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("DelegateKeyword"), i3n("ReturnType"), i4n("Identifier"), i5n("TypeParameterList"), i6n("ParameterList"), i7n("ConstraintClauses"), i8n("SemicolonToken"));
        enum_declaration.Seq(attribute_list_s_opt, modifier_s_opt, EnumKeyword, IdentifierToken, base_list_opt, OpenBraceToken, enum_member_declaration_scc_opt, CloseBraceToken, semicolon_token_opt)
            .ProjectStruct("_EnumDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("EnumKeyword"), i3n("Identifier"), i4n("BaseList"), i5n("OpenBraceToken"), i6n("Members"), i7n("CloseBraceToken"), i8n("SemicolonToken"));
        enum_member_declaration_scc_opt.ListOpt(enum_member_declaration_scc);
        enum_member_declaration_scc.SeparatedList(CommaToken, enum_member_declaration, true);
        enum_member_declaration.Seq(attribute_list_s_opt, IdentifierToken, equals_value_clause_opt)
            .ProjectStruct("_EnumMemberDeclaration", i0n("AttributeLists"), i1n("Identifier"), i2n("EqualsValue"));
        class_declaration.Seq(attribute_list_s_opt, modifier_s_opt, ClassKeyword, IdentifierToken, type_parameter_list_opt, base_list_opt, type_parameter_constraint_clause_s_opt, OpenBraceToken, type_member_s_opt, CloseBraceToken, semicolon_token_opt)
            .ProjectStruct("_ClassDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("ClassKeyword"), i3n("Identifier"), i4n("TypeParameterList"), i5n("BaseList"), i6n("ConstraintClauses"), i7n("OpenBraceToken"), i8n("Members"), i9n("CloseBraceToken"), i10n("SemicolonToken"));
        struct_declaration.Seq(attribute_list_s_opt, modifier_s_opt, StructKeyword, IdentifierToken, type_parameter_list_opt, base_list_opt, type_parameter_constraint_clause_s_opt, OpenBraceToken, type_member_s_opt, CloseBraceToken, semicolon_token_opt)
            .ProjectStruct("_StructDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("StructKeyword"), i3n("Identifier"), i4n("TypeParameterList"), i5n("BaseList"), i6n("ConstraintClauses"), i7n("OpenBraceToken"), i8n("Members"), i9n("CloseBraceToken"), i10n("SemicolonToken"));
        interface_declaration.Seq(attribute_list_s_opt, modifier_s_opt, InterfaceKeyword, IdentifierToken, type_parameter_list_opt, base_list_opt, type_parameter_constraint_clause_s_opt, OpenBraceToken, type_member_s_opt, CloseBraceToken, semicolon_token_opt)
            .ProjectStruct("_InterfaceDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("InterfaceKeyword"), i3n("Identifier"), i4n("TypeParameterList"), i5n("BaseList"), i6n("ConstraintClauses"), i7n("OpenBraceToken"), i8n("Members"), i9n("CloseBraceToken"), i10n("SemicolonToken"));
        //
        type_member_s_opt.ListOpt(type_member_s);
        type_member_s.List(type_member);
        type_member.Choice(type_declaration, field_declaration, event_field_declaration, method_declaration, operator_declaration,
            conversion_operator_declaration, constructor_declaration, destructor_declaration, property_declaration, event_declaration, indexer_declaration);
        field_declaration.Seq(attribute_list_s_opt, modifier_s_opt, variable_declaration, SemicolonToken)
            .ProjectStruct("_FieldDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("Declaration"), i3n("SemicolonToken"));
        event_field_declaration.Seq(attribute_list_s_opt, modifier_s_opt, EventKeyword, variable_declaration, SemicolonToken)
            .ProjectStruct("_FieldDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("EventKeyword"), i3n("Declaration"), i4n("SemicolonToken"));
        method_declaration.Seq(attribute_list_s_opt, modifier_s_opt, type, explicit_interface_specifier_opt, IdentifierToken, type_parameter_list_opt, parameter_list, type_parameter_constraint_clause_s_opt, block_opt, semicolon_token_opt)
            .ProjectStruct("_MethodDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("ReturnType"), i3n("ExplicitInterfaceSpecifier"), i4n("Identifier"), i5n("TypeParameterList"), i6n("ParameterList"), i7n("ConstraintClauses"), i8n("Body"), i9n("SemicolonToken"));
        operator_declaration.Seq(attribute_list_s_opt, modifier_s_opt, type, OperatorKeyword, overloadable_operator, parameter_list, block_opt, semicolon_token_opt)
            .ProjectStruct("_OperatorDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("ReturnType"), i3n("OperatorKeyword"), i4n("OperatorToken"), i5n("ParameterList"), i6n("Body"), i7n("SemicolonToken"));
        overloadable_operator.Choice(PlusToken, MinusToken, AsteriskEqualsToken, SlashToken, PercentToken, AmpersandToken, BarToken,
           CaretToken, ExclamationToken, TildeToken, PlusPlusToken, MinusMinusToken, LessThanLessThanToken, GreaterThanGreaterThanToken,
           EqualsEqualsToken, ExclamationEqualsToken, GreaterThanToken, LessThanToken, GreaterThanEqualsToken, LessThanEqualsToken,
           TrueKeyword, FalseKeyword);
        conversion_operator_declaration.Seq(attribute_list_s_opt, modifier_s_opt, implicit_or_explicit_keyword, OperatorKeyword, type, parameter_list, block_opt, semicolon_token_opt)
            .ProjectStruct("_ConversionOperatorDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("ImplicitOrExplicitKeyword"), i3n("OperatorKeyword"), i4n("Type"), i5n("ParameterList"), i6n("Body"), i7n("SemicolonToken"));
        implicit_or_explicit_keyword.Choice(ImplicitKeyword, ExplicitKeyword);
        constructor_declaration.Seq(attribute_list_s_opt, modifier_s_opt, IdentifierToken, parameter_list, constructor_initializer_opt, block_opt, semicolon_token_opt)
            .ProjectStruct("_ConstructorDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("Identifier"), i3n("ParameterList"), i4n("Initializer"), i5n("Body"), i6n("SemicolonToken"));
        constructor_initializer_opt.Opt(constructor_initializer);
        constructor_initializer.Choice(constructor_initializer_this, constructor_initializer_base);
        constructor_initializer_this.Seq(ColonToken, ThisKeyword, argument_list)
            .ProjectStruct("_ConstructorInitializer", Node.Int32("Kind", (int)SyntaxKind.ThisConstructorInitializer), i0n("ColonToken"), i1n("ThisOrBaseKeyword"), i2n("ArgumentList"));
        constructor_initializer_base.Seq(ColonToken, BaseKeyword, argument_list)
            .ProjectStruct("_ConstructorInitializer", Node.Int32("Kind", (int)SyntaxKind.BaseConstructorInitializer), i0n("ColonToken"), i1n("ThisOrBaseKeyword"), i2n("ArgumentList"));
        destructor_declaration.Seq(attribute_list_s_opt, modifier_s_opt, TildeToken, IdentifierToken, parameter_list, block_opt, semicolon_token_opt)
            .ProjectStruct("_DestructorDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("TildeToken"), i3n("Identifier"), i4n("ParameterList"), i5n("Body"), i6n("SemicolonToken"));
        //
        property_declaration.Seq(attribute_list_s_opt, modifier_s_opt, type, explicit_interface_specifier_opt, IdentifierToken, property_accessor_list)
            .ProjectStruct("_PropertyDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("Type"), i3n("ExplicitInterfaceSpecifier"), i4n("Identifier"), i5n("AccessorList"));
        indexer_declaration.Seq(attribute_list_s_opt, modifier_s_opt, type, explicit_interface_specifier_opt, ThisKeyword, bracketed_parameter_list, property_accessor_list)
            .ProjectStruct("_IndexerDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("Type"), i3n("ExplicitInterfaceSpecifier"), i4n("ThisKeyword"), i5n("ParameterList"), i6n("AccessorList"));
        property_accessor_list.Seq(OpenBraceToken, property_accessor_declaration_s, CloseBraceToken)
            .ProjectStruct("_AccessorList", i0n("OpenBraceToken"), i1n("Accessors"), i2n("CloseBraceToken"));
        property_accessor_declaration_s.List(property_accessor_declaration);
        property_accessor_declaration.Choice(property_accessor_declaration_get, property_accessor_declaration_set);
        property_accessor_declaration_get.Seq(attribute_list_s_opt, modifier_s_opt, GetKeyword, block_opt, semicolon_token_opt)
            .ProjectStruct("_AccessorDeclaration", Node.Int32("Kind", (int)SyntaxKind.GetAccessorDeclaration), i0n("AttributeLists"), i1n("Modifiers"), i2n("Keyword"), i3n("Body"), i4n("SemicolonToken"));
        property_accessor_declaration_set.Seq(attribute_list_s_opt, modifier_s_opt, SetKeyword, block_opt, semicolon_token_opt)
            .ProjectStruct("_AccessorDeclaration", Node.Int32("Kind", (int)SyntaxKind.SetAccessorDeclaration), i0n("AttributeLists"), i1n("Modifiers"), i2n("Keyword"), i3n("Body"), i4n("SemicolonToken"));
        //
        event_declaration.Seq(attribute_list_s_opt, modifier_s_opt, EventKeyword, type, explicit_interface_specifier_opt, IdentifierToken, event_accessor_list)
            .ProjectStruct("_EventDeclaration", i0n("AttributeLists"), i1n("Modifiers"), i2n("EventKeyword"), i3n("Type"), i4n("ExplicitInterfaceSpecifier"), i5n("Identifier"), i6n("AccessorList"));
        event_accessor_list.Seq(OpenBraceToken, event_accessor_declaration_s, CloseBraceToken)
            .ProjectStruct("_AccessorList", i0n("OpenBraceToken"), i1n("Accessors"), i2n("CloseBraceToken"));
        event_accessor_declaration_s.List(event_accessor_declaration);
        event_accessor_declaration.Choice(event_accessor_declaration_add, event_accessor_declaration_remove);
        event_accessor_declaration_add.Seq(attribute_list_s_opt, modifier_s_opt, AddKeyword, block)
            .ProjectStruct("_AccessorDeclaration", Node.Int32("Kind", (int)SyntaxKind.AddAccessorDeclaration), i0n("AttributeLists"), i1n("Modifiers"), i2n("Keyword"), i3n("Body"), Node.Null("SemicolonToken"));
        event_accessor_declaration_remove.Seq(attribute_list_s_opt, modifier_s_opt, RemoveKeyword, block)
            .ProjectStruct("_AccessorDeclaration", Node.Int32("Kind", (int)SyntaxKind.RemoveAccessorDeclaration), i0n("AttributeLists"), i1n("Modifiers"), i2n("Keyword"), i3n("Body"), Node.Null("SemicolonToken"));
        //
        base_list_opt.Opt(base_list);
        base_list.Seq(ColonToken, type_sc)
            .ProjectStruct("_BaseList", i0n("ColonToken"), i1n("Types"));
        explicit_interface_specifier_opt.Opt(explicit_interface_specifier);
        explicit_interface_specifier.Seq(name, DotToken)
            .ProjectStruct("_ExplicitInterfaceSpecifier", i0n("Name"), i1n("DotToken"));
        type_argument_list.Seq(PreferShiftHere(), LessThanToken, type_argument_list_arguments, GreaterThanToken)
            .ProjectStruct("_TypeArgumentList", i0n("LessThanToken"), i1n("Arguments"), i2n("GreaterThanToken"));
        type_argument_list_arguments.Choice(type_argument_list_arguments_omitted, type_argument_list_arguments_separated);
        type_argument_list_arguments_omitted.List(CommaToken, "__");
        type_argument_list_arguments_separated.SeparatedList(CommaToken, type, false);
        type_parameter_list_opt.Opt(type_parameter_list);
        type_parameter_list.Seq(LessThanToken, type_parameter_sc, GreaterThanToken)
            .ProjectStruct("_TypeParameterList", i0n("LessThanToken"), i1n("Parameters"), i2n("GreaterThanToken"));
        type_parameter_sc.SeparatedList(CommaToken, type_parameter, false);
        type_parameter.Seq(attribute_list_s_opt, variance_keyword_opt, IdentifierToken)
            .ProjectStruct("_TypeParameter", i0n("AttributeLists"), i1n("VarianceKeyword"), i2n("Identifier"));
        variance_keyword_opt.Opt(variance_keyword);
        variance_keyword.Choice(InKeyword, OutKeyword);
        //
        type_parameter_constraint_clause_s_opt.ListOpt(type_parameter_constraint_clause_s);
        type_parameter_constraint_clause_s.List(type_parameter_constraint_clause);
        type_parameter_constraint_clause.Seq(WhereKeyword, identifier_name, ColonToken, type_parameter_constraint_sc)
            .ProjectStruct("_TypeParameterConstraintClause", i0n("WhereKeyword"), i1n("Identifier"), i2n("ColonToken"), i3n("Constraints"));
        type_parameter_constraint_sc.SeparatedList(CommaToken, type_parameter_constraint, false);
        type_parameter_constraint.Choice(constructor_constraint, class_or_struct_constraint, type_constraint);
        constructor_constraint.Seq(NewKeyword, OpenParenToken, CloseParenToken)
            .ProjectStruct("_ConstructorConstraint", i0n("NewKeyword"), i1n("OpenParenToken"), i2n("CloseParenToken"));
        type_constraint.Seq(type)
            .ProjectStruct("_TypeConstraint", i0n("Type"));
        class_or_struct_constraint.Choice(class_or_struct_constraint_class, class_or_struct_constraint_struct);
        class_or_struct_constraint_class.Seq(ClassKeyword)
            .ProjectStruct("_ClassOrStructConstraint", Node.Int32("Kind", (int)SyntaxKind.ClassConstraint), i0n("ClassOrStructKeyword"));
        class_or_struct_constraint_struct.Seq(StructKeyword)
            .ProjectStruct("_ClassOrStructConstraint", Node.Int32("Kind", (int)SyntaxKind.StructConstraint), i0n("ClassOrStructKeyword"));
        //
        argument_list_opt.Opt(argument_list);
        argument_list.Seq(PreferShiftHere(), OpenParenToken, argument_sc_opt, CloseParenToken)
            .ProjectStruct("_ArgumentList", i0n("OpenParenToken"), i1n("Arguments"), i2n("CloseParenToken"));
        bracketed_argument_list_opt.Opt(bracketed_argument_list);
        bracketed_argument_list.Seq(OpenBracketToken, argument_sc_opt, CloseBracketToken)
              .ProjectStruct("_BracketedArgumentList", i0n("OpenBracketToken"), i1n("Arguments"), i2n("CloseBracketToken"));
        argument_sc_opt.ListOpt(argument_sc);
        argument_sc.SeparatedList(CommaToken, argument, false);
        argument.Seq(name_colon_opt, ref_or_out_keyword_opt, expression)
            .ProjectStruct("_Argument", i0n("NameColon"), i1n("RefOrOutKeyword"), i2n("Expression"));
        ref_or_out_keyword_opt.Opt(ref_or_out_keyword);
        ref_or_out_keyword.Choice(RefKeyword, OutKeyword);
        //
        parameter_list_opt.Opt(parameter_list);
        parameter_list.Seq(OpenParenToken, parameter_sc_opt, CloseParenToken)
            .ProjectStruct("_ParameterList", i0n("OpenParenToken"), i1n("Parameters"), i2n("CloseParenToken"));
        bracketed_parameter_list.Seq(OpenBracketToken, parameter_sc_opt, CloseBracketToken)
            .ProjectStruct("_BracketedParameterList", i0n("OpenBracketToken"), i1n("Parameters"), i2n("CloseBracketToken"));
        parameter_sc.SeparatedList(CommaToken, parameter, false);
        parameter_sc_opt.ListOpt(parameter_sc);
        parameter.Seq(attribute_list_s_opt, parameter_modifier_s_opt, type_opt, IdentifierToken, equals_value_clause_opt)
            .ProjectStruct("_Parameter", i0n("AttributeLists"), i1n("Modifiers"), i2n("Type,"), i3n("Identifier"), i4n("Default"));
        parameter_modifier_s_opt.ListOpt(parameter_modifier_s);
        parameter_modifier_s.List(parameter_modifier);
        parameter_modifier.Choice(ref_or_out_keyword, ThisKeyword, ParamsKeyword);
        //
        name_equals_opt.Opt(name_equals);
        name_equals.Seq(identifier_name, EqualsToken)
            .ProjectStruct("_NameEquals", i0n("Identifier"), i1n("EqualsToken"));
        name_colon_opt.Opt(name_colon);
        name_colon.Seq(identifier_name, ColonToken)
            .ProjectStruct("_NameColon", i0n("Identifier"), i1n("ColonToken"));
        equals_value_clause_opt.Opt(equals_value_clause);
        equals_value_clause.Seq(EqualsToken, expression)
            .ProjectStruct("_EqualsValueClause", i0n("EqualsToken"), i1n("Value"));
        //
        statement_s_opt.ListOpt(statement_s);
        statement_s.List(statement);
        statement.Choice(labeled_statement, local_declaration_statement, embedded_statement);
        labeled_statement.Seq(IdentifierToken, ColonToken, statement)
            .ProjectStruct("_LabeledStatement", i0n("Identifier"), i1n("ColonToken"), i2n("Statement"));
        //
        local_declaration_statement.Seq(modifier_s_opt, variable_declaration, SemicolonToken)
            .ProjectStruct("_LocalDeclarationStatement", i0n("Modifiers"), i1n("Declaration"), i2n("SemicolonToken"));
        variable_declaration_opt.Opt(variable_declaration);
        variable_declaration.Seq(type, variable_declarator_sc)
            .ProjectStruct("_VariableDeclaration", i0n("Type"), i1n("Variables"));
        variable_declarator_sc.SeparatedList(CommaToken, variable_declarator, false);
        variable_declarator.Seq(IdentifierToken, bracketed_argument_list_opt, equals_value_clause_variable_declarator_opt)
            .ProjectStruct("_VariableDeclarator", i0n("Identifier"), i1n("ArgumentList"), i2n("Initializer"));
        equals_value_clause_variable_declarator_opt.Opt(equals_value_clause_variable_declarator);
        equals_value_clause_variable_declarator.Seq(EqualsToken, variable_declarator_value)
            .ProjectStruct("_EqualsValueClause", i0n("EqualsToken"), i1n("Value"));
        variable_declarator_value_scc_opt.ListOpt(variable_declarator_value_scc);
        variable_declarator_value_scc.SeparatedList(CommaToken, variable_declarator_value, true);
        variable_declarator_value.Choice(expression, array_initializer);
        //
        embedded_statement.Choice(block, empty_statement, expression_statement, selection_statement, iteration_statement,
            jump_statement, try_statement, checked_statement, unchecked_statement, lock_statement, using_statement, yield_statement);
        block_opt.Opt(block);
        block.Seq(OpenBraceToken, statement_s_opt, CloseBraceToken)
            .ProjectStruct("_Block", i0n("OpenBraceToken"), i1n("Statements"), i2n("CloseBraceToken"));
        empty_statement.Seq(SemicolonToken)
            .ProjectStruct("_EmptyStatement", i0n("SemicolonToken"));
        expression_statement.Seq(statement_expression, SemicolonToken)
            .ProjectStruct("_ExpressionStatement", i0n("Expression"), i1n("SemicolonToken"));
        statement_expression_sc_opt.ListOpt(statement_expression_sc);
        statement_expression_sc.SeparatedList(CommaToken, statement_expression, false);
        statement_expression.Choice(invocation_expression, object_creation_expression, assignment_expression,
            prefix_unary_expression_pre_increment, prefix_unary_expression_pre_decrement, postfix_unary_expression);
        //
        selection_statement.Choice(if_statement, switch_statement);
        if_statement.Seq(IfKeyword, OpenParenToken, expression, CloseParenToken, embedded_statement, else_clause_opt)
            .ProjectStruct("_IfStatement", i0n("IfKeyword"), i1n("OpenParenToken"), i2n("Condition"), i3n("CloseParenToken"), i4n("Statement"), i5n("Else"));
        else_clause_opt.Opt(else_clause);
        else_clause.Seq(ElseKeyword, embedded_statement)
            .ProjectStruct("_ElseClause", i0n("ElseKeyword"), i1n("Statement"));
        switch_statement.Seq(SwitchKeyword, OpenParenToken, expression, CloseParenToken, OpenBraceToken, switch_section_s_opt, CloseBraceToken)
            .ProjectStruct("_SwitchStatement", i0n("SwitchKeyword"), i1n("OpenParenToken"), i2n("Expression"), i3n("CloseParenToken"), i4n("OpenBraceToken"), i5n("Sections"), i6n("CloseBraceToken"));
        switch_section_s_opt.ListOpt(switch_section_s);
        switch_section_s.List(switch_section);
        switch_section.Seq(switch_label_s, statement_s)
            .ProjectStruct("_SwitchSection", i0n("Labels"), i1n("Statements"));
        switch_label_s.List(switch_label);
        switch_label.Choice(switch_label_case, switch_label_default);
        switch_label_case.Seq(CaseKeyword, expression, ColonToken)
            .ProjectStruct("_SwitchLabel", Node.Int32("Kind", (int)SyntaxKind.CaseSwitchLabel), i0n("CaseOrDefaultKeyword"), i1n("Value"), i2n("ColonToken"));
        switch_label_default.Seq(DefaultKeyword, ColonToken)
            .ProjectStruct("_SwitchLabel", Node.Int32("Kind", (int)SyntaxKind.DefaultSwitchLabel), i0n("CaseOrDefaultKeyword"), Node.Null("Value"), i1n("ColonToken"));
        //
        iteration_statement.Choice(while_statement, do_statement, for_statement, foreach_statement);
        while_statement.Seq(WhileKeyword, OpenParenToken, expression, CloseParenToken, embedded_statement)
            .ProjectStruct("_WhileStatement", i0n("WhileKeyword"), i1n("OpenParenToken"), i2n("Condition"), i3n("CloseParenToken"), i4n("Statement"));
        do_statement.Seq(DoKeyword, embedded_statement, WhileKeyword, OpenParenToken, expression, CloseParenToken, SemicolonToken)
            .ProjectStruct("DoKeyword", i0n("Statement"), i1n("WhileKeyword"), i2n("OpenParenToken"), i3n("Condition"), i4n("CloseParenToken"), i5n("SemicolonToken"));
        for_statement.Seq(ForKeyword, OpenParenToken, variable_declaration_opt, statement_expression_sc_opt, SemicolonToken, expression_opt, SemicolonToken, statement_expression_sc_opt, CloseParenToken, embedded_statement)
            .ProjectStruct("_ForStatement", i0n("ForKeyword"), i1n("OpenParenToken"), i2n("Declaration"), i3n("Initializers"), i4n("FirstSemicolonToken"), i5n("Condition"), i6n("SecondSemicolonToken"), i7n("Incrementors"), i8n("CloseParenToken"), i9n("Statement"));
        foreach_statement.Seq(ForEachKeyword, OpenParenToken, type, IdentifierToken, InKeyword, expression, CloseParenToken, embedded_statement)
            .ProjectStruct("_ForEachStatement", i0n("ForEachKeyword"), i1n("OpenParenToken"), i2n("Type"), i3n("Identifier"), i4n("InKeyword"), i5n("Expression"), i6n("CloseParenToken"), i7n("Statement"));
        //
        jump_statement.Choice(break_statement, continue_statement, goto_statement, return_statement, throw_statement);
        break_statement.Seq(BreakKeyword, SemicolonToken)
            .ProjectStruct("_BreakStatement", i0n("BreakKeyword"), i1n("SemicolonToken"));
        continue_statement.Seq(ContinueKeyword, SemicolonToken)
            .ProjectStruct("_ContinueStatement", i0n("ContinueKeyword"), i1n("SemicolonToken"));
        goto_statement.Choice(goto_statement_normal, goto_statement_case, goto_statement_default);
        goto_statement_normal.Seq(GotoKeyword, identifier_name, SemicolonToken)
            .ProjectStruct("_GotoStatement", Node.Int32("Kind", (int)SyntaxKind.GotoStatement), i0n("GotoKeyword"), Node.Null("CaseOrDefaultKeyword"), i1n("Expression"), i2n("SemicolonToken"));
        goto_statement_case.Seq(GotoKeyword, CaseKeyword, expression, SemicolonToken)
            .ProjectStruct("_GotoStatement", Node.Int32("Kind", (int)SyntaxKind.GotoCaseStatement), i0n("GotoKeyword"), i1n("CaseOrDefaultKeyword"), i2n("Expression"), i3n("SemicolonToken"));
        goto_statement_default.Seq(GotoKeyword, DefaultKeyword, SemicolonToken)
            .ProjectStruct("_GotoStatement", Node.Int32("Kind", (int)SyntaxKind.GotoDefaultStatement), i0n("GotoKeyword"), Node.Null("CaseOrDefaultKeyword"), Node.Null("Expression"), i1n("SemicolonToken"));
        return_statement.Seq(ReturnKeyword, expression_opt, SemicolonToken)
            .ProjectStruct("_ReturnStatement", i0n("ReturnKeyword"), i1n("Expression"), i2n("SemicolonToken"));
        throw_statement.Seq(ThrowKeyword, expression_opt, SemicolonToken)
            .ProjectStruct("_ThrowStatement", i0n("ThrowKeyword"), i1n("Expression"), i2n("SemicolonToken"));
        //
        try_statement.Seq(TryKeyword, block, catch_clause_s_opt, finally_clause_opt)
            .ProjectStruct("_TryStatement", i0n("TryKeyword"), i1n("Block"), i2n("Catches"), i3n("Finally"));
        catch_clause_s_opt.ListOpt(catch_clause_s);
        catch_clause_s.List(catch_clause);
        catch_clause.Seq(CatchKeyword, catch_declaration_opt, block)
            .ProjectStruct("_CatchClause", i0n("Declaration"), i1n("Block"));
        catch_declaration_opt.Opt(catch_declaration);
        catch_declaration.Seq(OpenParenToken, type, identifier_token_opt, CloseParenToken)
            .ProjectStruct("_CatchDeclaration", i0n("OpenParenToken"), i1n("Type"), i2n("Identifier"), i3n("CloseParenToken"));
        finally_clause_opt.Opt(finally_clause);
        finally_clause.Seq(FinallyKeyword, block)
            .ProjectStruct("_FinallyClause", i0n("FinallyKeyword"), i1n("Block"));
        //
        checked_statement.Seq(CheckedKeyword, block)
            .ProjectStruct("_CheckedStatement", Node.Int32("Kind", (int)SyntaxKind.CheckedStatement), i0n("CheckedOrUncheckedKeyword"), i1n("Block"));
        unchecked_statement.Seq(UncheckedKeyword, block)
            .ProjectStruct("_CheckedStatement", Node.Int32("Kind", (int)SyntaxKind.UncheckedStatement), i0n("CheckedOrUncheckedKeyword"), i1n("Block"));
        lock_statement.Seq(LockKeyword, OpenParenToken, expression, CloseParenToken, embedded_statement)
            .ProjectStruct("_LockStatement", i0n("LockKeyword"), i1n("OpenParenToken"), i2n("Expression"), i3n("CloseParenToken"), i4n("Statement"));
        using_statement.Choice(using_statement_declaration, using_statement_expression);
        using_statement_declaration.Seq(UsingKeyword, OpenParenToken, variable_declaration, CloseParenToken, embedded_statement)
            .ProjectStruct("_UsingStatement", i0n("UsingKeyword"), i1n("OpenParenToken"), i2n("Declaration"), Node.Null("Expression"), i3n("CloseParenToken"), i4n("Statement"));
        using_statement_expression.Seq(UsingKeyword, OpenParenToken, expression, CloseParenToken, embedded_statement)
            .ProjectStruct("_UsingStatement", i0n("UsingKeyword"), i1n("OpenParenToken"), Node.Null("Declaration"), i2n("Expression"), i3n("CloseParenToken"), i4n("Statement"));
        yield_statement.Choice(yield_statement_return, yield_statement_break);
        yield_statement_return.Seq(YieldKeyword, ReturnKeyword, expression, SemicolonToken)
            .ProjectStruct("_YieldStatement", Node.Int32("Kind", (int)SyntaxKind.YieldReturnStatement), i0n("YieldKeyword"), i1n("ReturnOrBreakKeyword"), i2n("Expression"), i3n("SemicolonToken"));
        yield_statement_break.Seq(YieldKeyword, BreakKeyword, SemicolonToken)
            .ProjectStruct("_YieldStatement", Node.Int32("Kind", (int)SyntaxKind.YieldBreakStatement), i0n("YieldKeyword"), i1n("ReturnOrBreakKeyword"), Node.Null("Expression"), i2n("SemicolonToken"));
        //
        expression_scc_opt.ListOpt(expression_scc);
        expression_scc.SeparatedList(CommaToken, expression, true);
        expression_opt.Opt(expression);
        expression.Choice(non_assignment_expression, assignment_expression);
        //expression.Choice(primary_expression);
        expression.AppendChoice(__GetExpression());
        //
        assignment_expression.Choice(assignment_expression_assign, assignment_expression_add, assignment_expression_subtract,
            assignment_expression_multiply, assignment_expression_divide, assignment_expression_modulo, assignment_expression_and,
            assignment_expression_exclusive_or, assignment_expression_or, assignment_expression_left_shift, assignment_expression_right_shift);
        assignment_expression_assign.Seq(prefix_unary_expression, EqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_add.Seq(prefix_unary_expression, PlusEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AddAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_subtract.Seq(prefix_unary_expression, MinusEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.SubtractAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_multiply.Seq(prefix_unary_expression, AsteriskEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.MultiplyAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_divide.Seq(prefix_unary_expression, SlashEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.DivideAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_modulo.Seq(prefix_unary_expression, PercentEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.ModuloAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_and.Seq(prefix_unary_expression, AmpersandEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AndAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_exclusive_or.Seq(prefix_unary_expression, CaretEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.ExclusiveOrAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_or.Seq(prefix_unary_expression, BarEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.OrAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_left_shift.Seq(prefix_unary_expression, LessThanLessThanEqualsToken, expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LeftShiftAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        assignment_expression_right_shift.Seq(prefix_unary_expression, GreaterThanGreaterThanEqualsToken, expression)//todo
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.RightShiftAssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        //
        non_assignment_expression.Choice(lambda_expression, query_expression, conditional_expression);
        lambda_expression.Choice(simple_lambda_expression, parenthesized_lambda_expression);
        simple_lambda_expression.Seq(parameter, EqualsGreaterThanToken, lambda_body)
            .ProjectStruct("_SimpleLambdaExpression", i0n("Parameter"), i1n("EqualsGreaterThanToken"), i2n("Body"));
        parenthesized_lambda_expression.Seq(parameter_list, EqualsGreaterThanToken, lambda_body)
            .ProjectStruct("_ParenthesizedLambdaExpression", i0n("ParameterList"), i1n("EqualsGreaterThanToken"), i2n("Body"));
        lambda_body.Choice(expression, block);
        //
        conditional_expression.Choice(conditional_expression_main, coalescing_expression);
        conditional_expression_main.Seq(coalescing_expression, QuestionToken, expression, ColonToken, expression)
            .ProjectStruct("_ConditionalExpression", i0n("Condition"), i1n("QuestionToken"), i2n("WhenTrue"), i3n("ColonToken"), i4n("WhenFalse"));
        coalescing_expression.Choice(coalescing_expression_main, logical_or_expression);
        coalescing_expression_main.Seq(logical_or_expression, QuestionQuestionToken, coalescing_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.CoalesceExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        logical_or_expression.Choice(logical_or_expression_main, logical_and_expression);
        logical_or_expression_main.Seq(logical_or_expression, BarBarToken, logical_and_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LogicalOrExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        logical_and_expression.Choice(logical_and_expression_main, bitwise_or_expression);
        logical_and_expression_main.Seq(logical_and_expression, AmpersandAmpersandToken, bitwise_or_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LogicalAndExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        bitwise_or_expression.Choice(bitwise_or_expression_main, exclusive_or_expression);
        bitwise_or_expression_main.Seq(bitwise_or_expression, BarToken, exclusive_or_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.BitwiseOrExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        exclusive_or_expression.Choice(exclusive_or_expression_main, bitwise_and_expression);
        exclusive_or_expression_main.Seq(exclusive_or_expression, CaretToken, bitwise_and_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.ExclusiveOrExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        bitwise_and_expression.Choice(bitwise_and_expression_main, equality_expression);
        bitwise_and_expression_main.Seq(bitwise_and_expression, AmpersandToken, equality_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.BitwiseAndExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        equality_expression.Choice(equality_expression_equals, equality_expression_not_equals, relational_expression);
        equality_expression_equals.Seq(equality_expression, EqualsEqualsToken, relational_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.EqualsExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        equality_expression_not_equals.Seq(equality_expression, ExclamationEqualsToken, relational_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.NotEqualsExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression.Choice(relational_expression_less_than, relational_expression_less_than_or_equal,
            relational_expression_greater_than, relational_expression_greater_than_or_equal,
            relational_expression_is, relational_expression_as, shift_expression);
        relational_expression_less_than.Seq(relational_expression, LessThanToken, shift_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LessThanExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression_less_than_or_equal.Seq(relational_expression, LessThanEqualsToken, shift_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LessThanOrEqualExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression_greater_than.Seq(relational_expression, GreaterThanToken, shift_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.GreaterThanExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression_greater_than_or_equal.Seq(relational_expression, GreaterThanEqualsToken, shift_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.GreaterThanOrEqualExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression_is.Seq(relational_expression, IsKeyword, type)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.IsExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        relational_expression_as.Seq(relational_expression, AsKeyword, type)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AsExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        shift_expression.Choice(shift_expression_left, shift_expression_right, additive_expression);
        shift_expression_left.Seq(shift_expression, LessThanLessThanToken, additive_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.LeftShiftExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        shift_expression_right.Seq(shift_expression, GreaterThanGreaterThanToken, additive_expression)//todo
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.RightShiftExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        additive_expression.Choice(additive_expression_add, additive_expression_subtract, multiplicative_expression);
        additive_expression_add.Seq(additive_expression, PlusToken, multiplicative_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AddExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        additive_expression_subtract.Seq(additive_expression, MinusToken, multiplicative_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.SubtractExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        multiplicative_expression.Choice(multiplicative_expression_multiply, multiplicative_expression_divide, multiplicative_expression_modulo,
            prefix_unary_expression);
        multiplicative_expression_multiply.Seq(multiplicative_expression, AsteriskToken, prefix_unary_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.MultiplyExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        multiplicative_expression_divide.Seq(multiplicative_expression, SlashToken, prefix_unary_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.DivideExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        multiplicative_expression_modulo.Seq(multiplicative_expression, PercentToken, prefix_unary_expression)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.ModuloExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        prefix_unary_expression.Choice(prefix_unary_expression_plus, prefix_unary_expression_negate, prefix_unary_expression_logical_not,
            prefix_unary_expression_bitwise_not, prefix_unary_expression_pre_increment, prefix_unary_expression_pre_decrement,
            prefix_unary_expression_cast, primary_expression);
        prefix_unary_expression_plus.Seq(PlusPlusToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.PlusExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_negate.Seq(MinusToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.NegateExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_logical_not.Seq(ExclamationToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.LogicalNotExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_bitwise_not.Seq(TildeToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.BitwiseNotExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_pre_increment.Seq(PlusPlusToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.PreIncrementExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_pre_decrement.Seq(MinusMinusToken, prefix_unary_expression)
            .ProjectStruct("_PrefixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.PreDecrementExpression), i0n("OperatorToken"), i1n("Operand"));
        prefix_unary_expression_cast.Seq(OpenParenToken, type, CloseParenToken, prefix_unary_expression)
            .ProjectStruct("_CastExpression", i0n("OperatorToken"), i1n("type"), i2n("CloseParenToken"), i3n("Expression"));
        //
        primary_expression.Choice(parenthesized_expression, literal_expression, this_expression, base_expression,
            postfix_unary_expression, typeof_expression, checked_expression, default_expression, member_access_expression,
            element_access_expression, invocation_expression, anonymous_method_expression, object_creation_expression,
            array_creation_expression, implicit_array_creation_expression, anonymous_object_creation_expression, type
            );
        primary_expression.AppendChoice(__GetPrimaryExpression());
        parenthesized_expression.Seq(OpenParenToken, expression, CloseParenToken)
            .ProjectStruct("_ParenthesizedExpression", i0n("OpenParenToken"), i1n("Expression"), i2n("CloseParenToken"));
        literal_expression.Choice(literal_expression_true, literal_expression_false, literal_expression_null,
            literal_expression_numeric_literal, literal_expression_character_literal, literal_expression_string_literal);
        literal_expression_true.Seq(TrueKeyword)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.TrueLiteralExpression), i0n("Token"));
        literal_expression_false.Seq(FalseKeyword)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.FalseLiteralExpression), i0n("Token"));
        literal_expression_null.Seq(NullKeyword)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.NullLiteralExpression), i0n("Token"));
        literal_expression_numeric_literal.Seq(NumericLiteralToken)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.NumericLiteralExpression), i0n("Token"));
        literal_expression_character_literal.Seq(CharacterLiteralToken)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.CharacterLiteralExpression), i0n("Token"));
        literal_expression_string_literal.Seq(StringLiteralToken)
            .ProjectStruct("_LiteralExpression", Node.Int32("Kind", (int)SyntaxKind.StringLiteralExpression), i0n("Token"));
        this_expression.Seq(ThisKeyword).ProjectStruct("_ThisExpression", i0n("Token"));
        base_expression.Seq(BaseKeyword).ProjectStruct("_BaseExpression", i0n("Token"));
        postfix_unary_expression.Choice(postfix_unary_expression_increment, postfix_unary_expression_decrement);
        postfix_unary_expression_increment.Seq(primary_expression, PreferShiftHere(), PlusPlusToken)
            .ProjectStruct("_PostfixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.PostIncrementExpression), i0n("Operand"), i1n("OperatorToken"));
        postfix_unary_expression_decrement.Seq(primary_expression, PreferShiftHere(), MinusMinusToken)
            .ProjectStruct("_PostfixUnaryExpression", Node.Int32("Kind", (int)SyntaxKind.PostDecrementExpression), i0n("Operand"), i1n("OperatorToken"));
        typeof_expression.Seq(TypeOfKeyword, OpenParenToken, type, CloseParenToken)
            .ProjectStruct("_TypeOfExpression", i0n("Keyword"), i1n("OpenParenToken"), i2n("Type"), i3n("CloseParenToken"));
        checked_expression.Choice(checked_expression_checked, checked_expression_unchecked);
        checked_expression_checked.Seq(CheckedKeyword, OpenParenToken, expression, CloseParenToken)
            .ProjectStruct("_CheckedExpression", Node.Int32("Kind", (int)SyntaxKind.CheckedExpression), i0n("Keyword"), i1n("OpenParenToken"), i2n("Expression"), i3n("CloseParenToken"));
        checked_expression_unchecked.Seq(UncheckedKeyword, OpenParenToken, expression, CloseParenToken)
            .ProjectStruct("_CheckedExpression", Node.Int32("Kind", (int)SyntaxKind.UncheckedExpression), i0n("Keyword"), i1n("OpenParenToken"), i2n("Expression"), i3n("CloseParenToken"));
        default_expression.Seq(DefaultKeyword, OpenParenToken, type, CloseParenToken)
            .ProjectStruct("_DefaultExpression", i0n("Keyword"), i1n("OpenParenToken"), i2n("Type"), i3n("CloseParenToken"));
        member_access_expression.Seq(primary_expression, DotToken, simple_name)
            .ProjectStruct("_MemberAccessExpression", Node.Int32("Kind", (int)SyntaxKind.MemberAccessExpression), i0n("Expression"), i1n("OperatorToken"), i2n("Name"));
        element_access_expression.Seq(primary_expression, bracketed_argument_list)
            .ProjectStruct("_ElementAccessExpression", i0n("Expression"), i1n("ArgumentList"));
        invocation_expression.Seq(primary_expression, argument_list)
            .ProjectStruct("_InvocationExpression", i0n("Expression"), i1n("ArgumentList"));
        anonymous_method_expression.Seq(DelegateKeyword, parameter_list_opt, block)
            .ProjectStruct("_AnonymousMethodExpression", i0n("DelegateKeyword"), i1n("ParameterList"), i2n("Block"));
        object_creation_expression.Seq(NewKeyword, type, argument_list_opt, object_or_collection_initializer_opt)
            .ProjectStruct("_ObjectCreationExpression", i0n("NewKeyword"), i1n("Type"), i2n("ArgumentList"), i3n("Initializer"));
        array_creation_expression.Seq(NewKeyword, array_type, array_initializer_opt)
            .ProjectStruct("_ArrayCreationExpression", i0n("NewKeyword"), i1n("Type"), i2n("Initializer"));
        implicit_array_creation_expression.Seq(NewKeyword, OpenBracketToken, comma_token_s_opt, CloseBracketToken, array_initializer)
            .ProjectStruct("_ImplicitArrayCreationExpression", i0n("NewKeyword"), i1n("OpenBracketToken"), i2n("Commas"), i3n("CloseBracketToken"), i4n("Initializer"));
        object_or_collection_initializer_opt.Opt(object_or_collection_initializer);
        object_or_collection_initializer.Choice(object_initializer, collection_initializer);
        object_initializer.Seq(OpenBraceToken, object_member_initializer_scc_opt, CloseBraceToken)
            .ProjectStruct("_InitializerExpression", Node.Int32("Kind", (int)SyntaxKind.ObjectInitializerExpression), i0n("OpenBraceToken"), i1n("Expressions"), i2n("CloseBraceToken"));
        object_member_initializer_scc_opt.ListOpt(object_member_initializer_scc);
        object_member_initializer_scc.SeparatedList(CommaToken, object_member_initializer, true);
        object_member_initializer.Seq(identifier_name, EqualsToken, object_member_initializer_value)
            .ProjectStruct("_BinaryExpression", Node.Int32("Kind", (int)SyntaxKind.AssignExpression), i0n("Left"), i1n("OperatorToken"), i2n("Right"));
        object_member_initializer_value.Choice(expression, object_or_collection_initializer);
        collection_initializer.Seq(OpenBraceToken, collection_element_initializer_scc_opt, CloseBraceToken)
            .ProjectStruct("_InitializerExpression", Node.Int32("Kind", (int)SyntaxKind.CollectionInitializerExpression), i0n("OpenBraceToken"), i1n("Expressions"), i2n("CloseBraceToken"));
        collection_element_initializer_scc_opt.ListOpt(collection_element_initializer_scc);
        collection_element_initializer_scc.SeparatedList(CommaToken, collection_element_initializer, true);
        collection_element_initializer.Choice(non_assignment_expression, complex_element_initializer);
        complex_element_initializer.Seq(OpenBraceToken, expression_scc_opt, CloseBraceToken)
            .ProjectStruct("_InitializerExpression", Node.Int32("Kind", (int)SyntaxKind.ComplexElementInitializerExpression), i0n("OpenBraceToken"), i1n("Expressions"), i2n("CloseBraceToken"));
        array_initializer_opt.Opt(array_initializer);
        array_initializer.Seq(PreferShiftHere(), OpenBraceToken, variable_declarator_value_scc_opt, CloseBraceToken)
            .ProjectStruct("_InitializerExpression", Node.Int32("Kind", (int)SyntaxKind.ArrayInitializerExpression), i0n("OpenBraceToken"), i1n("Expressions"), i2n("CloseBraceToken"));
        anonymous_object_creation_expression.Seq(NewKeyword, OpenBraceToken, anonymous_object_member_declarator_scc_opt, CloseBraceToken)
            .ProjectStruct("_AnonymousObjectCreationExpression", i0n("NewKeyword"), i1n("OpenBraceToken"), i2n("Initializers"), i3n("CloseBraceToken"));
        anonymous_object_member_declarator_scc_opt.ListOpt(anonymous_object_member_declarator_scc);
        anonymous_object_member_declarator_scc.SeparatedList(CommaToken, anonymous_object_member_declarator, true);
        anonymous_object_member_declarator.Seq(name_equals_opt, expression)
            .ProjectStruct("_AnonymousObjectMemberDeclarator", i0n("NameEquals"), i1n("Expression"));
        //
        query_expression.Seq(from_clause, query_body)
            .ProjectStruct("_QueryExpression", i0n("FromClause"), i1n("Body"));
        from_clause.Seq(FromKeyword, type_opt, IdentifierToken, InKeyword, expression)
            .ProjectStruct("_FromClause", i0n("FromKeyword"), i1n("Type"), i2n("Identifier"), i3n("InKeyword"), i4n("Expression"));
        query_body.Seq(query_body_clause_s_opt, select_or_group_clause, query_continuation_opt)
            .ProjectStruct("_QueryBody", i0n("Clauses"), i1n("SelectOrGroup"), i2n("Continuation"));
        query_body_clause_s_opt.ListOpt(query_body_clause_s);
        query_body_clause_s.List(query_body_clause);
        query_body_clause.Choice(from_clause, let_clause, join_clause, where_clause, orderby_clause);
        let_clause.Seq(LetKeyword, IdentifierToken, EqualsToken, expression)
            .ProjectStruct("_LetClause", i0n("LetKeyword"), i1n("Identifier"), i2n("EqualsToken"), i3n("Expression"));
        join_clause.Seq(JoinKeyword, type_opt, IdentifierToken, InKeyword, expression, OnKeyword, expression, EqualsKeyword, expression, join_into_clause_opt)
            .ProjectStruct("_JoinClause", i0n("JoinKeyword"), i1n("Type"), i2n("Identifier"), i3n("InKeyword"), i4n("InExpression"), i5n("OnKeyword"), i6n("LeftExpression"), i7n("EqualsKeyword"), i8n("RightExpression"), i9n("Into"));
        join_into_clause_opt.Opt(join_into_clause);
        join_into_clause.Seq(IntoKeyword, IdentifierToken)
            .ProjectStruct("_JoinIntoClause", i0n("IntoKeyword"), i1n("Identifier"));
        where_clause.Seq(WhereKeyword, expression)
            .ProjectStruct("_WhereClause", i0n("WhereKeyword"), i1n("Condition"));
        orderby_clause.Seq(OrderByKeyword, ordering_sc)
            .ProjectStruct("_OrderByClause", i0n("OrderByKeyword"), i1n("Orderings"));
        ordering_sc.SeparatedList(CommaToken, ordering, false);
        ordering.Choice(ordering_ascending, ordering_descending);
        ordering_ascending.Seq(expression, ascending_keyword_opt)
            .ProjectStruct("_Ordering", Node.Int32("Kind", (int)SyntaxKind.AscendingOrdering), i0n("Expression"), i1n("AscendingOrDescendingKeyword"));
        ascending_keyword_opt.Opt(AscendingKeyword);
        ordering_descending.Seq(expression, DescendingKeyword)
            .ProjectStruct("_Ordering", Node.Int32("Kind", (int)SyntaxKind.DescendingOrdering), i0n("Expression"), i1n("AscendingOrDescendingKeyword"));
        select_or_group_clause.Choice(select_clause, group_clause);
        select_clause.Seq(SelectKeyword, expression)
            .ProjectStruct("_SelectClause", i0n("SelectKeyword"), i1n("Expression"));
        group_clause.Seq(GroupKeyword, expression, ByKeyword, expression)
            .ProjectStruct("_GroupClause", i0n("GroupKeyword"), i1n("GroupExpression"), i2n("ByKeyword"), i3n("ByExpression"));
        query_continuation_opt.Opt(query_continuation);
        query_continuation.Seq(IntoKeyword, IdentifierToken, query_body)
            .ProjectStruct("_QueryContinuation", i0n("IntoKeyword"), i1n("Identifier"), i2n("Body"));

        //
        type_sc.SeparatedList(CommaToken, type, false);
        type_opt.Opt(type);
        type.Choice(non_array_type, array_type);
        non_array_type.Choice(name, nullable_type, predefined_type);
        nullable_type.Seq(type, PreferShiftHere(), QuestionToken)
            .ProjectStruct("_NullableType", i0n("ElementType"), i1n("QuestionToken"));
        predefined_type.Seq(predefined_type_keyword)
            .ProjectStruct("_PredefinedType", i0n("Keyword"));
        predefined_type_keyword.Choice(BoolKeyword, ByteKeyword, SByteKeyword, ShortKeyword, UShortKeyword, IntKeyword, UIntKeyword,
            LongKeyword, ULongKeyword, DoubleKeyword, FloatKeyword, DecimalKeyword, StringKeyword, CharKeyword, VoidKeyword, ObjectKeyword);
        array_type.Seq(non_array_type, array_rank_specifier_s)
            .ProjectStruct("_ArrayType", i0n("ElementType"), i1n("RankSpecifiers"));
        array_rank_specifier_s.List(array_rank_specifier);
        array_rank_specifier.Seq(PreferShiftHere(), OpenBracketToken, array_rank_specifier_sizes, CloseBracketToken)
            .ProjectStruct("_ArrayRankSpecifier", i0n("OpenBracketToken"), i1n("Sizes"), i2n("CloseBracketToken"));
        array_rank_specifier_sizes.Choice(array_rank_specifier_sizes_omitted, array_rank_specifier_sizes_separated);
        array_rank_specifier_sizes_omitted.List(CommaToken, "__");
        array_rank_specifier_sizes_separated.SeparatedList(CommaToken, expression, false);
        //
        name.Choice(simple_name, qualified_name, alias_qualified_name);
        simple_name.Choice(identifier_name, generic_name);
        identifier_name.Seq(PreferShiftHere(), IdentifierToken)
            .ProjectStruct("_IdentifierName", i0n("Identifier"));
        generic_name.Seq(IdentifierToken, type_argument_list)
            .ProjectStruct("_GenericName", i0n("Identifier"), i1n("TypeArgumentList"));
        qualified_name.Seq(name, PreferShiftHere(), DotToken, simple_name)
            .ProjectStruct("_QualifiedName", i0n("Left"), i1n("DotToken"), i2n("Right"));
        alias_qualified_name.Seq(alias_qualified_name_alias, ColonColonToken, simple_name)
            .ProjectStruct("_AliasQualifiedName", i0n("Alias"), i1n("ColonColonToken"), i2n("Name"));
        alias_qualified_name_alias.Choice(identifier_name, global_keyword_identifier_name);
        //
        global_keyword_identifier_name.Seq(GlobalKeyword)
            .ProjectStruct("_IdentifierName", i0n("Identifier"));
        comma_token_s_opt.Opt(comma_token_s);
        comma_token_s.List(CommaToken);
        identifier_token_opt.Opt(IdentifierToken);
        semicolon_token_opt.Opt(SemicolonToken);
        //
        //this.LanguageFlags = LanguageFlags.CreateAst;
    }
    //
    internal Terminal __CreateToken(SyntaxKind kind)
    {
        var text = SyntaxFacts.GetText(kind);
        var term = ToTerm(text);
        if (kind.IsReservedKeyword()) term.SetFlag(TermFlags.IsReservedWord);
        //else if (kind.IsPunctuation())
        //{
        //    term.SetFlag(TermFlags.IsPunctuation);
        //}
        term.SetFlag(TermFlags.NoAstNode, false);
        return term.ProjectStruct("_SyntaxToken", Node.Int32("Kind", (int)kind));
    }
    //internal static readonly char[] NewLineCharacters = { '\u000A'/*LineFeed \n*/, '\u000D'/*CarriageReturn \r*/, '\u0085'/*NextLine*/, '\u2028'/*LineSeparator*/, '\u2029'/*ParagraphSeparator*/  };
    internal static readonly string[] NewLineStrings = { "\u000A"/*LineFeed \n*/, "\u000D"/*CarriageReturn \r*/, "\u0085"/*NextLine*/, "\u2028"/*LineSeparator*/, "\u2029"/*ParagraphSeparator*/  };
    internal static bool IsNewLine(char ch) { return CharacterInfo.IsNewLine(ch); }
    internal static bool IsWhitespace(char ch) { return CharacterInfo.IsWhitespace(ch); }
    public override sealed void SkipWhitespace(ISourceStream source)
    {
        while (!source.EOF())
        {
            var ch = source.PreviewChar;
            if (IsWhitespace(ch) || IsNewLine(ch)) source.PreviewPosition++;
            else return;
        }
    }
    internal BnfExpression MakeListRuleEx(NonTerminal list, BnfTerm delimiter, BnfTerm listMember, TermListOptions options) { return base.MakeListRule(list, delimiter, listMember, options); }
    #region helpers
    internal static IndexNameProjectionArgument i0n(string name) { return new IndexNameProjectionArgument(0, name); }
    internal static IndexNameProjectionArgument i1n(string name) { return new IndexNameProjectionArgument(1, name); }
    internal static IndexNameProjectionArgument i2n(string name) { return new IndexNameProjectionArgument(2, name); }
    internal static IndexNameProjectionArgument i3n(string name) { return new IndexNameProjectionArgument(3, name); }
    internal static IndexNameProjectionArgument i4n(string name) { return new IndexNameProjectionArgument(4, name); }
    internal static IndexNameProjectionArgument i5n(string name) { return new IndexNameProjectionArgument(5, name); }
    internal static IndexNameProjectionArgument i6n(string name) { return new IndexNameProjectionArgument(6, name); }
    internal static IndexNameProjectionArgument i7n(string name) { return new IndexNameProjectionArgument(7, name); }
    internal static IndexNameProjectionArgument i8n(string name) { return new IndexNameProjectionArgument(8, name); }
    internal static IndexNameProjectionArgument i9n(string name) { return new IndexNameProjectionArgument(9, name); }
    internal static IndexNameProjectionArgument i10n(string name) { return new IndexNameProjectionArgument(10, name); }
    internal static IndexNameProjectionArgument i11n(string name) { return new IndexNameProjectionArgument(11, name); }
    internal static IndexNameProjectionArgument i12n(string name) { return new IndexNameProjectionArgument(12, name); }
    internal static IndexNameProjectionArgument i13n(string name) { return new IndexNameProjectionArgument(13, name); }
    internal static IndexNameProjectionArgument i14n(string name) { return new IndexNameProjectionArgument(14, name); }
    internal static IndexNameProjectionArgument i15n(string name) { return new IndexNameProjectionArgument(15, name); }
    internal static IndexNameProjectionArgument i16n(string name) { return new IndexNameProjectionArgument(16, name); }
    internal static IndexNameProjectionArgument i17n(string name) { return new IndexNameProjectionArgument(17, name); }
    internal static IndexNameProjectionArgument i18n(string name) { return new IndexNameProjectionArgument(18, name); }
    internal static IndexNameProjectionArgument i19n(string name) { return new IndexNameProjectionArgument(19, name); }
    #endregion helpers
    //C# syntax extensibility
    internal virtual NonTerminal __GetNamespaceAnnotations() { return null; }
    internal virtual NonTerminal __GetNamespaceProlog() { return null; }
    internal virtual NonTerminal __GetNamespaceMember() { return null; }
    internal virtual NonTerminal __GetExpression() { return null; }
    internal virtual NonTerminal __GetPrimaryExpression() { return null; }

}
internal static class GrammarExtensions
{
    internal static void List(this NonTerminal list, BnfTerm item, string label = null)
    {
        if (list == null || list.Rule != null || item == null) throw new InvalidOperationException();
        list.Rule = Grammar.CurrentGrammar.MakePlusRule(list, item);
    }
    internal static void SeparatedList(this NonTerminal list, BnfTerm separator, BnfTerm item, bool allowTrailingDelimiter, string label = null)
    {
        if (list == null || list.Rule != null || separator == null || item == null) throw new InvalidOperationException();
        list.Rule = ((CSGrammar)Grammar.CurrentGrammar).MakeListRuleEx(list, separator, item, TermListOptions.PlusList | (allowTrailingDelimiter ? TermListOptions.AllowTrailingDelimiter : TermListOptions.None));
    }
    internal static void Opt(this NonTerminal nonTerminal, BnfTerm term)
    {
        if (nonTerminal == null || nonTerminal.Rule != null || term == null) throw new InvalidOperationException();
        nonTerminal.Rule = Grammar.CurrentGrammar.Empty | term;
    }
    internal static void ListOpt(this NonTerminal nonTerminal, NonTerminal term)
    {
        if (nonTerminal == null || nonTerminal.Rule != null || term == null) throw new InvalidOperationException();
        nonTerminal.Rule = Grammar.CurrentGrammar.Empty | term;
    }
    internal static NonTerminal Seq(this NonTerminal nonTerminal, params BnfTerm[] items)
    {
        if (nonTerminal == null || nonTerminal.Rule != null || items == null || items.Length == 0) throw new InvalidOperationException();
        var r = new BnfExpression(items[0]);
        for (var i = 1; i < items.Length; i++) r += items[i];
        nonTerminal.Rule = r;
        return nonTerminal;
    }
    internal static void Choice(this NonTerminal nonTerminal, params BnfTerm[] items)
    {
        if (nonTerminal == null || nonTerminal.Rule != null || items == null || items.Length == 0) throw new InvalidOperationException();
        var r = new BnfExpression(items[0]);
        for (var i = 1; i < items.Length; i++) r |= items[i];
        nonTerminal.Rule = r;
    }
    internal static void AppendChoice(this NonTerminal nonTerminal, BnfTerm item)
    {
        if (nonTerminal == null || nonTerminal.Rule == null) throw new InvalidOperationException();
        if (item != null) nonTerminal.Rule |= item;
    }
    //AstNode constructions code omitted...
    internal static NonTerminal ProjectStruct(this NonTerminal nonTerminal, string label, params object[] members)
    {
        return nonTerminal;
    }
    internal static Terminal ProjectStruct(this Terminal terminal, string label, params object[] members)
    {
        return terminal;
    }
}
//ast node
internal sealed class Node 
{
    internal static Node Null(string name) { return  null; }
    internal static Node Int32(string name, int value) { return null; }
}
class IndexNameProjectionArgument
{
    public IndexNameProjectionArgument(int index, string name) { }
}